`pip install` 在某些软件包上出现错误

oas*_*333 9 python dependencies pip setuptools setup.py

当我尝试使用某些软件包安装它们时,它们会出现错误pip install。这是我尝试安装时的错误chatterbot, but some other packages give this error as well:

\n
pip install chatterbot\nCollecting chatterbot\n  Using cached ChatterBot-1.0.5-py2.py3-none-any.whl (67 kB)\nCollecting pint>=0.8.1\n  Downloading Pint-0.19.2.tar.gz (292 kB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 292.0/292.0 kB 1.6 MB/s eta 0:00:00\n  Installing build dependencies ... done\n  Getting requirements to build wheel ... done\n  Preparing metadata (pyproject.toml) ... done\nCollecting pyyaml<5.2,>=5.1\n  Using cached PyYAML-5.1.2.tar.gz (265 kB)\n  Preparing metadata (setup.py) ... done\nCollecting spacy<2.2,>=2.1\n  Using cached spacy-2.1.9.tar.gz (30.7 MB)\n  Installing build dependencies ... error\n  error: subprocess-exited-with-error\n\n  \xc3\x97 pip subprocess to install build dependencies did not run successfully.\n  \xe2\x94\x82 exit code: 1\n  \xe2\x95\xb0\xe2\x94\x80> [35 lines of output]\n      Collecting setuptools\n        Using cached setuptools-65.0.1-py3-none-any.whl (1.2 MB)\n      Collecting wheel<0.33.0,>0.32.0\n        Using cached wheel-0.32.3-py2.py3-none-any.whl (21 kB)\n      Collecting Cython\n        Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB)\n      Collecting cymem<2.1.0,>=2.0.2\n        Using cached cymem-2.0.6-cp310-cp310-win_amd64.whl (36 kB)\n      Collecting preshed<2.1.0,>=2.0.1\n        Using cached preshed-2.0.1.tar.gz (113 kB)\n        Preparing metadata (setup.py): started\n        Preparing metadata (setup.py): finished with status \'error\'\n        error: subprocess-exited-with-error\n\n        python setup.py egg_info did not run successfully.\n        exit code: 1\n\n        [6 lines of output]\n        Traceback (most recent call last):\n          File "<string>", line 2, in <module>\n          File "<pip-setuptools-caller>", line 34, in <module>\n          File "C:\\Users\\oguls\\AppData\\Local\\Temp\\pip-install-qce7tdof\\preshed_546a51fe26c74852ab50db073ad57f1f\\setup.py", line 9, in <module>\n            from distutils import ccompiler, msvccompiler\n        ImportError: cannot import name \'msvccompiler\' from \'distutils\' (C:\\Users\\oguls\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\setuptools\\_distutils\\__init__.py)\n        [end of output]\n\n        note: This error originates from a subprocess, and is likely not a problem with pip.\n      error: metadata-generation-failed\n\n      Encountered error while generating package metadata.\n\n      See above for output.\n\n      note: This is an issue with the package mentioned above, not pip.\n      hint: See above for details.\n      [end of output]\n\n  note: This error originates from a subprocess, and is likely not a problem with pip.\nerror: subprocess-exited-with-error\n\n\xc3\x97 pip subprocess to install build dependencies did not run successfully.\n\xe2\x94\x82 exit code: 1\n\xe2\x95\xb0\xe2\x94\x80> See above for output.\n\nnote: This error originates from a subprocess, and is likely not a problem with pip.\n
Run Code Online (Sandbox Code Playgroud)\n

我具体不知道哪些软件包导致了此错误,其中很多安装都没有任何问题

\n

我尝试过更新 pip、更改环境变量以及我在互联网上找到的其他可能的解决方案,但似乎没有任何效果。

\n

编辑:我尝试安装的包支持我的 Python 版本。

\n

Evg*_*423 9

您的情况的真正错误是:

\n
ImportError: cannot import name \'msvccompiler\' from \'distutils\'\n
Run Code Online (Sandbox Code Playgroud)\n

发生这种情况是因为version\xc2\xa065.0.0setuptools 已损坏distutils(并且已在 version\xc2\xa065.0.2 中修复)。根据您的日志,错误发生在您的全局setuptools安装中(请参阅错误消息中的路径),因此您需要使用以下命令进行更新:

\n
pip install -U setuptools\n
Run Code Online (Sandbox Code Playgroud)\n

但是,这些包可能仍然无法安装 xc2xa0 或无法正常工作,因为导致此错误的模块不支持当前支持的 Python 版本所需的编译器版本

\n