如何在debian服务器上安装discord lib(websocket错误)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何在debian服务器上安装discord lib(websocket错误)相关的知识,希望对你有一定的参考价值。
我试图在我的外部debian服务器上安装discord库,并使用
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
Full Output:
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.orgprojectwebocketss。)我得到这个回报。
[...]
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
我怎么才能安装这个?
答案
现在你已经提供了完整的错误信息,很明显你使用的是python 3.4版本进行安装。
/usr/lib/python3.4/distutils/dist.py #This is one line from your error
但是... aiohttp
有一个最低要求的python 3.5版本,你也可以看到在 这个github问题 对我来说,这是在谷歌的第二个结果,当我输入你的错误。'PosixPath' object has no attribute 'read_text'
)
然而,你已经给python 3.8打了标签,所以你应该检查你的设置,因为 python3
似乎没有调用你认为的Python版本。
以上是关于如何在debian服务器上安装discord lib(websocket错误)的主要内容,如果未能解决你的问题,请参考以下文章
在 Debian 8 VPS 上托管 C# Discord 机器人