Python使用pip安裝No matching distribution found for PyYaml==5.3.1

 ERROR: Command errored out with exit status 1:
     command: /usr/local/dmahz/p_book_data/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yqn97g8t/pyyaml_30670ccf25cc4caf94c339671933c1ca/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yqn97g8t/pyyaml_30670ccf25cc4caf94c339671933c1ca/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-vc7iszg1
         cwd: /tmp/pip-install-yqn97g8t/pyyaml_30670ccf25cc4caf94c339671933c1ca/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/local/dmahz/p_book_data/lib/python3.9/site-packages/setuptools/__init__.py", line 23, in <module>
        from setuptools.dist import Distribution
      File "/usr/local/dmahz/p_book_data/lib/python3.9/site-packages/setuptools/dist.py", line 34, in <module>
        from setuptools import windows_support
      File "/usr/local/dmahz/p_book_data/lib/python3.9/site-packages/setuptools/windows_support.py", line 2, in <module>
        import ctypes
      File "/usr/local/lib/python3.9/ctypes/__init__.py", line 8, in <module>
        from _ctypes import Union, Structure, Array
    ModuleNotFoundError: No module named '_ctypes'
    ----------------------------------------
WARNING: Discarding http://mirrors.tencentyun.com/pypi/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz#sha256=b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d (from http://mirrors.tencentyun.com/pypi/simple/pyyaml/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement PyYaml==5.3.1
ERROR: No matching distribution found for PyYaml==5.3.1

解決方案就是 查看對應的python包是否支持當前python的版本,如果不支持就會出現上圖異常,樓主是更新了一下包的版本(包支持當前python的版本)即可,

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章