gpt4 book ai didi

python - 在 Python 3.8.0 中使用 pip 安装 numpy 时如何修复 "ERROR: Command errored out with exit status 1"

转载 作者:行者123 更新时间:2023-12-03 19:23:40 34 4
gpt4 key购买 nike

将 Python 升级到 3.8.0 后,我无法使用 pip 安装与 numpy 相关的软件包,包括 numpy、matplotlib 和 sklearn。
错误信息如下:

我应该怎么做才能解决这个问题?

C:\WINDOWS\System32>pip install numpy

...

Installing collected packages: numpy
Running setup.py install for numpy ... error
ERROR: Command errored out with exit status 1: command: 'c:\users\tonakai\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Tonakai\\AppData\\Local\\Temp\\pip-install-ub45_c1a\\numpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Tonakai\\AppData\\Local\\Temp\\pip-install-ub45_c1a\\numpy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Tonakai\AppData\Local\Temp\pip-record-3pg_3uvq\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\Tonakai\AppData\Local\Temp\pip-install-ub45_c1a\numpy\
Complete output (299 lines):
Running from numpy source directory.

Note: if you need reliable uninstall behavior, then install
with pip instead of using `setup.py install`:

- `pip install .` (from a git repo or downloaded source
release)
- `pip install numpy` (last NumPy release on PyPi)

blas_mkl_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
libraries mkl_rt not found in ['c:\\users\\tonakai\\appdata\\local\\programs\\python\\python38\\lib', 'C:\\', 'c:\\users\\tonakai\\appdata\\local\\programs\\python\\python38\\libs']
NOT AVAILABLE
...

c:\users\tonakai\appdata\local\programs\python\python38\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
non-existing path in 'numpy\\random': 'src\\splitmix64\\splitmix.h'
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
building library "npymath" sources
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\tonakai\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Tonakai\\AppData\\Local\\Temp\\pip-install-ub45_c1a\\numpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Tonakai\\AppData\\Local\\Temp\\pip-install-ub45_c1a\\numpy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Tonakai\AppData\Local\Temp\pip-record-3pg_3uvq\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

最佳答案

您需要升级 setuptools和 pip 。你可以通过运行来做到这一 pip :

pip install -U pip setuptools
然后你可以运行你的 pip install numpy .

关于python - 在 Python 3.8.0 中使用 pip 安装 numpy 时如何修复 "ERROR: Command errored out with exit status 1",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58387267/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com