Python “Failed to install packages” error

huangapple go评论226阅读模式
英文:

Python "Failed to install packages" error

问题

我正在使用Pycharm作为我的集成开发环境(IDE),在尝试安装pandas时遇到了错误。我已经提供了我的Python和pip版本的图片以及我的Python解释器供参考。

错误消息如下:

  1. Using cached pandas-2.0.2.tar.gz (5.3 MB)
  2. Installing build dependencies: started
  3. Installing build dependencies: finished with status 'error'
  4. error: subprocess-exited-with-error
  5. pip subprocess to install build dependencies did not run successfully.
  6. exit code: 1
  7. ...

感谢您的帮助。

英文:

I am using Pycharm as my IDE and I am encountering an error while attempting to install pandas. I have provided images of my Python and pip versions and my python interpreters for reference.
image of python and pip versions. -->
image of the python interpeters. -->
image of venv interpeter (it seemed awkward so i posted it)-->,
The error message I am receiving is as follows:

  1. Using cached pandas-2.0.2.tar.gz (5.3 MB)
  2. Installing build dependencies: started
  3. Installing build dependencies: finished with status 'error'
  4. error: subprocess-exited-with-error
  5. pip subprocess to install build dependencies did not run successfully.
  6. exit code: 1
  7. [76 lines of output]
  8. Collecting setuptools>=61.0.0
  9. Using cached setuptools-67.8.0-py3-none-any.whl (1.1 MB)
  10. Collecting wheel
  11. Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
  12. Collecting Cython<3,>=0.29.33
  13. Using cached Cython-0.29.35-py2.py3-none-any.whl (988 kB)
  14. Collecting oldest-supported-numpy>=2022.8.16
  15. Using cached oldest_supported_numpy-2022.11.19-py3-none-any.whl (4.9 kB)
  16. Collecting versioneer[toml]
  17. Using cached versioneer-0.28-py3-none-any.whl (45 kB)
  18. Collecting numpy==1.19.3
  19. Using cached numpy-1.19.3.zip (7.3 MB)
  20. Installing build dependencies: started
  21. Installing build dependencies: finished with status 'done'
  22. Getting requirements to build wheel: started
  23. Getting requirements to build wheel: finished with status 'error'
  24. error: subprocess-exited-with-error
  25. Getting requirements to build wheel did not run successfully.
  26. exit code: 1
  27. [40 lines of output]
  28. Traceback (most recent call last):
  29. File "C:\Users538\PycharmProjects\CSV\venv\lib\python3.9\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
  30. main()
  31. File "C:\Users538\PycharmProjects\CSV\venv\lib\python3.9\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
  32. json_out['return_val'] = hook(**hook_input['kwargs'])
  33. File "C:\Users538\PycharmProjects\CSV\venv\lib\python3.9\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 112, in get_requires_for_build_wheel
  34. backend = _build_backend()
  35. File "C:\Users538\PycharmProjects\CSV\venv\lib\python3.9\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 77, in _build_backend
  36. obj = import_module(mod_path)
  37. File "C:\msys64\mingw64\lib\python3.9\importlib\__init__.py", line 127, in import_module
  38. return _bootstrap._gcd_import(name[level:], package, level)
  39. File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  40. File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  41. File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  42. File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  43. File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  44. File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  45. File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  46. File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  47. File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  48. File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  49. File "C:\Users538\AppData\Local\Temp\pip-build-env-nnvi2xem\overlay\lib\python3.9\site-packages\setuptools\__init__.py", line 253, in <module>
  50. monkey.patch_all()
  51. File "C:\Users538\AppData\Local\Temp\pip-build-env-nnvi2xem\overlay\lib\python3.9\site-packages\setuptools\monkey.py", line 101, in patch_all
  52. patch_for_msvc_specialized_compiler()
  53. File "C:\Users538\AppData\Local\Temp\pip-build-env-nnvi2xem\overlay\lib\python3.9\site-packages\setuptools\monkey.py", line 164, in patch_for_msvc_specialized_compiler
  54. patch_func(*msvc9('find_vcvarsall'))
  55. File "C:\Users538\AppData\Local\Temp\pip-build-env-nnvi2xem\overlay\lib\python3.9\site-packages\setuptools\monkey.py", line 151, in patch_params
  56. mod = import_module(mod_name)
  57. File "C:\msys64\mingw64\lib\python3.9\importlib\__init__.py", line 127, in import_module
  58. return _bootstrap._gcd_import(name[level:], package, level)
  59. File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  60. File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  61. File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  62. File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  63. File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  64. File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  65. File "C:\Users538\AppData\Local\Temp\pip-build-env-nnvi2xem\overlay\lib\python3.9\site-packages\setuptools\_distutils\msvc9compiler.py", line 295, in <module>
  66. raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION)
  67. distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module
  68. [end of output]
  69. note: This error originates from a subprocess, and is likely not a problem with pip.
  70. error: subprocess-exited-with-error
  71. Getting requirements to build wheel did not run successfully.
  72. exit code: 1
  73. See above for output.
  74. note: This error originates from a subprocess, and is likely not a problem with pip.
  75. [notice] A new release of pip available: 22.3.1 -> 23.1.2
  76. [notice] To update, run: python.exe -m pip install --upgrade pip
  77. [end of output]
  78. note: This error originates from a subprocess, and is likely not a problem with pip.
  79. error: subprocess-exited-with-error
  80. pip subprocess to install build dependencies did not run successfully.
  81. exit code: 1
  82. See above for output.
  83. note: This error originates from a subprocess, and is likely not a problem with pip.
  84. [notice] A new release of pip available: 22.3.1 -> 23.1.2
  85. [notice] To update, run: python.exe -m pip install --upgrade pip```
  86. Thank you for your help
  87. </details>
  88. # 答案1
  89. **得分**: 0
  90. 你尝试过升级pip吗?
  91. ```python
  92. pip install --upgrade pip
  93. # 或者如果使用pip3
  94. pip3 install --upgrade pip
  95. # 如果没有在PATH中找到pip
  96. python -m pip install --upgrade pip
  97. # 或者
  98. python3 -m pip install --upgrade pip

如果这还不够,尝试升级wheels:

  1. pip install --upgrade setuptools wheel
  2. # 或者
  3. pip3 install --upgrade setuptools wheel
  4. # 如果没有在PATH中找到pip
  5. python -m pip install --upgrade setuptools wheel
  6. # 或者
  7. python3 -m pip install --upgrade setuptools wheel
英文:

Have you tried to upgrade pip?

  1. pip install --upgrade pip
  2. # or if using pip3
  3. pip3 install --upgrade pip
  4. # if you don&#39;t have pip in PATH
  5. python -m pip install --upgrade pip
  6. # or
  7. python3 -m pip install --upgrade pip

If it is not enough, try to upgrade wheels as well:

  1. pip install --upgrade setuptools wheel
  2. # or
  3. pip3 install --upgrade setuptools wheel
  4. # if you don&#39;t have pip in PATH
  5. python -m pip install --upgrade setuptools wheel
  6. # or
  7. python3 -m pip install --upgrade setuptools wheel

答案2

得分: 0

我通过删除mingw64 python文件和彻底删除pycharm来解决了我的问题。然后我重新下载了pycharm,pycharm会自动获取解释器。如果你遇到同样的问题,只需从你的电脑上删除所有python版本和pycharm,然后重新下载pycharm。

英文:

I solved my problem by deleting mingw64 python files, and deleting pycharm completely. then i downloaded again and pycharm automatically get me interpeter. if you are having same problem just delete all python versions from your pc and pycharm too. then download pycharm again

huangapple
  • 本文由 发表于 2023年6月16日 14:43:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76487561.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定