【问题标题】:how to install discord lib on debian server (websocket error)如何在 debian 服务器上安装 discord lib(websocket 错误)
【发布时间】:2020-08-05 16:06:40
【问题描述】:

我尝试在我的外部 debian 服务器上安装不和谐库

python3 -m pip install -U git+https://github.com/Rapptz/discord.py.git

返回是:

[...]

Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-oq4dl632/websockets
Storing debug log for failure in /root/.pip/pip.log

完整输出:

Downloading/unpacking git+https://github.com/Rapptz/discord.py.git
  Cloning https://github.com/Rapptz/discord.py.git to /tmp/pip-vu76dg6y-build
  Running setup.py (path:/tmp/pip-vu76dg6y-build/setup.py) egg_info for package from git+https://github.com/Rapptz/discord.py.git
    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'project_urls'
      warnings.warn(msg)
    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'long_description_content_type'
      warnings.warn(msg)

Downloading/unpacking aiohttp>=3.6.0,<3.7.0 (from discord.py==1.4.0a2308-ge473f3c)
  Downloading aiohttp-3.6.2-py3-none-any.whl (441kB): 441kB downloaded
Downloading/unpacking websockets>=6.0,!=7.0,!=8.0,!=8.0.1,<9.0 (from discord.py==1.4.0a2308-ge473f3c)
  Downloading websockets-8.1.tar.gz (58kB): 58kB downloaded
  Running setup.py (path:/tmp/pip-build-ayxt1lcn/websockets/setup.py) egg_info for package websockets
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip-build-ayxt1lcn/websockets/setup.py", line 12, in <module>
        long_description = (root_dir / 'README.rst').read_text(encoding='utf-8')
    AttributeError: 'PosixPath' object has no attribute 'read_text'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip-build-ayxt1lcn/websockets/setup.py", line 12, in <module>

    long_description = (root_dir / 'README.rst').read_text(encoding='utf-8')

AttributeError: 'PosixPath' object has no attribute 'read_text'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-ayxt1lcn/websockets
Storing debug log for failure in /root/.pip/pip.log

如果我尝试安装 websockets (https://pypi.org/project/websockets/) 我会得到这个回报:

[...]

Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-d5s2p_/websockets
Storing debug log for failure in /root/.pip/pip.log

pip.log 返回:

Skipping (...) because it is not compatible with this Python

那么我该如何安装呢?

【问题讨论】:

  • 那么日志/root/.pip/pip.log是什么?
  • code 1 错误只是表明存在问题,因此很难仅使用它来做任何事情来调试问题。您可能会在指示的调试日志文件中看到有关失败的更多详细信息,以便更好地了解失败的原因和位置。
  • ok thx so... 跳过 (...) 因为它与此 Python 不兼容
  • 如果你使用pip3而不是pip呢?
  • @AdamTL pip3 ...Pythonversion 3.8

标签: python pip discord discord.py python-3.8


【解决方案1】:

现在您已经提供了完整的错误消息,很明显您正在使用 python 3.4 版进行安装:

/usr/lib/python3.4/distutils/dist.py    #This is one line from your error

但是aiohttp 具有最低要求的python 3.5 版本,您也可以在this github issue 中看到(当我输入错误'PosixPath' object has no attribute 'read_text' 时,这是谷歌的第二个结果)

但是你已经标记了 python 3.8,所以你应该检查你的设置,因为 python3 似乎没有调用你认为它正在调用的 python 版本

【讨论】:

    猜你喜欢
    • 2016-09-19
    • 2023-04-05
    • 2020-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-14
    相关资源
    最近更新 更多