Python 3.x 错误:sudo pip3.8 install websocket退出状态为1的命令出错,

Python 3.x 错误:sudo pip3.8 install websocket退出状态为1的命令出错,,python-3.x,pip,Python 3.x,Pip,就像我把pip install websockets安装在rasberry pi上的标题一样,就像在这个网站上说的那样,它把这个错误 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting websocket Using cached https://www.piwheels.org/simple/websocket/websocket-0.2.1-py3-none-any

就像我把pip install websockets安装在rasberry pi上的标题一样,就像在这个网站上说的那样,它把这个错误

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting websocket
  Using cached https://www.piwheels.org/simple/websocket/websocket-0.2.1-py3-none-any.whl (191 kB)
Collecting greenlet
  Using cached greenlet-0.4.16.tar.gz (60 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1r2o5cjv/greenlet/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1r2o5cjv/greenlet/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-u9pmz3n4
         cwd: /tmp/pip-install-1r2o5cjv/greenlet/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 19, in <module>
        from setuptools.dist import Distribution
      File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 34, in <module>
        from setuptools import windows_support
      File "/usr/local/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, in <module>
        import ctypes
      File "/usr/local/lib/python3.8/ctypes/__init__.py", line 7, in <module>
        from _ctypes import Union, Structure, Array
    ModuleNotFoundError: No module named '_ctypes'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
查找索引:https://pypi.org/simple, https://www.piwheels.org/simple
收集网匣
使用缓存https://www.piwheels.org/simple/websocket/websocket-0.2.1-py3-none-any.whl (191KB)
收集青菜
使用缓存的greenlet-0.4.16.tar.gz(60 kB)
错误:命令出错,退出状态为1:
命令:/usr/local/bin/python3.8-c'import sys、setuptools、tokenize;sys.argv[0]=“””/tmp/pip-install-1r2o5cjv/greenlet/setup.py“”__文件“''''/tmp/pip-install-1r2o5cjv/greenlet/setup.py''”;f=getattr(标记化,“'open'”,open)(\uuuuu文件);code=f.read().replace(“\r\n”“”、“\n”“”);f、 close();exec(编译(代码,“'exec'”)“egg\u info--egg base/tmp/pip-pip-egg-info-u9pmz3n4
cwd:/tmp/pip-install-1r2o5cjv/greenlet/
完整输出(11行):
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/usr/local/lib/python3.8/site packages/setuptools/_init__.py”,第19行,在
从setuptools.dist导入分发
文件“/usr/local/lib/python3.8/site packages/setuptools/dist.py”,第34行,在
从setuptools导入windows\u支持
文件“/usr/local/lib/python3.8/site packages/setuptools/windows_support.py”,第2行,在
导入ctypes
文件“/usr/local/lib/python3.8/ctypes/_init__.py”,第7行,在
从类型导入联合、结构、数组
ModuleNotFoundError:没有名为“\u ctypes”的模块
----------------------------------------
错误:命令出错,退出状态为1:python setup.py egg_info检查日志以获得完整的命令输出。
版本

-来自/usr/local/lib/python3.8/site-packages/pip(python 3.8)的PIP20.1.1

-Python 3.8.0

我试过(这篇文章是在文章发表后发表的)

此链接


尝试以下命令:

    python3.8 -m pip install ctypes
然后尝试与您相同的安装过程


希望这有帮助

尝试以下命令:

    python3.8 -m pip install ctypes
然后尝试与您相同的安装过程


希望这有帮助

hie和谢谢,但他指出了以下错误:`error:找不到满足要求的版本ctypes(来自versions:none)error:找不到ctypes的匹配分发版`
ctypes
is,您无法单独安装。hie和谢谢,但他指出了以下错误:`error:找不到满足要求的版本ctypes(来自versions:none)error:找不到与ctypes `
ctypes
is匹配的分发版,您不能单独安装。通过
/usr/local/
前缀,我可以猜您自己已经编译了Python。您的模块
ctypes未正确编译。
您需要安装必要的依赖项并重新编译Python。这是否回答了您的问题<代码>dist.py无条件。无。您需要安装
ctypes
'依赖项并重新编译Python。
sudo-apt-get-install-libffi-dev
或等效工具(使用
apt
aptitude
dselect
)。如果出现问题,您必须修复Debian安装。通过
/usr/local/
前缀,我可以猜您自己已经编译了Python。您的模块
ctypes未正确编译。
您需要安装必要的依赖项并重新编译Python。这是否回答了您的问题<代码>dist.py无条件。无。您需要安装
ctypes
'依赖项并重新编译Python。
sudo-apt-get-install-libffi-dev
或等效工具(使用
apt
aptitude
dselect
)。如果出现问题,您必须修复Debian安装。