所以我一直在尝试使用 Python 包选项卡在 Pycharm 上安装 numpy、pandas、matplotlib、Scikit Learn、scipy 和我学校工作所需的其他一些东西,但不断收到此错误:
Collecting numpy
Downloading numpy-1.24.3.tar.gz (10.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.9/10.9 MB 501.8 kB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [40 lines of output]
Traceback (most recent call last):
File "S:\Studying\Years\2nd\Semester_2\Introduction_to_Data_Science_&_Al\Lab_2\venv\lib\python3.10\site-packages\pip\_vendor\pyproject_
hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "S:\Studying\Years\2nd\Semester_2\Introduction_to_Data_Science_&_Al\Lab_2\venv\lib\python3.10\site-packages\pip\_vendor\pyproject_
hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "S:\Studying\Years\2nd\Semester_2\Introduction_to_Data_Science_&_Al\Lab_2\venv\lib\python3.10\site-packages\pip\_vendor\pyproject_
hooks\_in_process\_in_process.py", line 112, in get_requires_for_build_wheel
backend = _build_backend()
File "S:\Studying\Years\2nd\Semester_2\Introduction_to_Data_Science_&_Al\Lab_2\venv\lib\python3.10\site-packages\pip\_vendor\pyproject_
hooks\_in_process\_in_process.py", line 77, in _build_backend
obj = import_module(mod_path)
File "C:\msys64\mingw64\lib\python3.10\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 887, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\Hoang Minh Tri\AppData\Local\Temp\pip-build-env-cv52nuhn\overlay\lib\python3.10\site-packages\setuptools\__init__.py", l
ine 242, in <module>
monkey.patch_all()
File "C:\Users\Hoang Minh Tri\AppData\Local\Temp\pip-build-env-cv52nuhn\overlay\lib\python3.10\site-packages\setuptools\monkey.py", lin
e 99, in patch_all
patch_for_msvc_specialized_compiler()
File "C:\Users\Hoang Minh Tri\AppData\Local\Temp\pip-build-env-cv52nuhn\overlay\lib\python3.10\site-packages\setuptools\monkey.py", lin
e 162, in patch_for_msvc_specialized_compiler
patch_func(*msvc9('find_vcvarsall'))
File "C:\Users\Hoang Minh Tri\AppData\Local\Temp\pip-build-env-cv52nuhn\overlay\lib\python3.10\site-packages\setuptools\monkey.py", lin
e 149, in patch_params
mod = import_module(mod_name)
File "C:\msys64\mingw64\lib\python3.10\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 887, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\Hoang Minh Tri\AppData\Local\Temp\pip-build-env-cv52nuhn\overlay\lib\python3.10\site-packages\setuptools\_distutils\msvc
9compiler.py", line 295, in <module>
raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION)
distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
当我在终端上做同样的事情时,它似乎已经下载了(可能是我之前在 VSCode 中尝试做的)。我在 VSCode 中很好地安装了它们。我该怎么做才能使 PyCharm 安装工作?
以前在pycharm中经常遇到这个错误 我认为这是由于库的干扰,所以删除库并重新安装,如果没有解决,更新这个pip。 pip install --upgrade pip,也许错误会被修复 但一般来说,你在 pycharm 中会看到很多这样的错误,所以你最好使用虚拟环境。通过使用 venv 你会更少遇到这些错误