所以我在尝试使用 CMD 中的 pip 命令(pip install numba)将 numba 安装到 python 时遇到了问题,我总是得到以下输出和错误:
Collecting numba
Using cached numba-0.51.2.tar.gz (2.1 MB)
Requirement already satisfied: numpy>=1.15 in c:\users\se_320_gb\appdata\local\programs\python\python39\lib\site-packages (from numba) (1.19.4)
Requirement already satisfied: setuptools in c:\users\se_320_gb\appdata\local\programs\python\python39\lib\site-packages (from numba) (49.2.1)
Collecting llvmlite<0.35,>=0.34.0.dev0
Using cached llvmlite-0.34.0.tar.gz (107 kB)
Using legacy 'setup.py install' for numba, since package 'wheel' is not installed.
Using legacy 'setup.py install' for llvmlite, since package 'wheel' is not installed.
Installing collected packages: llvmlite, numba
Running setup.py install for llvmlite ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\se_320_gb\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Se_320_Gb\\AppData\\Local\\Temp\\pip-install-_v76h2mu\\llvmlite_0c956b9ff442433e8d48ac4e37563a11\\setup.py'"'"'; __file__='"'"'C:\\Users\\Se_320_Gb\\AppData\\Local\\Temp\\pip-install-_v76h2mu\\llvmlite_0c956b9ff442433e8d48ac4e37563a11\\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\Se_320_Gb\AppData\Local\Temp\pip-record-phjgzn90\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\se_320_gb\appdata\local\programs\python\python39\Include\llvmlite'
cwd: C:\Users\Se_320_Gb\AppData\Local\Temp\pip-install-_v76h2mu\llvmlite_0c956b9ff442433e8d48ac4e37563a11\
Complete output (27 lines):
running install
running build
got version from file C:\Users\Se_320_Gb\AppData\Local\Temp\pip-install-_v76h2mu\llvmlite_0c956b9ff442433e8d48ac4e37563a11\llvmlite/_version.py {'version': '0.34.0', 'full': 'c5889c9e98c6b19d5d85ebdd982d64a03931f8e2'}
running build_ext
c:\users\se_320_gb\appdata\local\programs\python\python39\python.exe C:\Users\Se_320_Gb\AppData\Local\Temp\pip-install-_v76h2mu\llvmlite_0c956b9ff442433e8d48ac4e37563a11\ffi\build.py
Trying generator 'Visual Studio 15 2017 Win64'
Traceback (most recent call last):
File "C:\Users\Se_320_Gb\AppData\Local\Temp\pip-install-_v76h2mu\llvmlite_0c956b9ff442433e8d48ac4e37563a11\ffi\build.py", line 191, in <module>
main()
File "C:\Users\Se_320_Gb\AppData\Local\Temp\pip-install-_v76h2mu\llvmlite_0c956b9ff442433e8d48ac4e37563a11\ffi\build.py", line 179, in main
main_win32()
File "C:\Users\Se_320_Gb\AppData\Local\Temp\pip-install-_v76h2mu\llvmlite_0c956b9ff442433e8d48ac4e37563a11\ffi\build.py", line 88, in main_win32
generator = find_win32_generator()
File "C:\Users\Se_320_Gb\AppData\Local\Temp\pip-install-_v76h2mu\llvmlite_0c956b9ff442433e8d48ac4e37563a11\ffi\build.py", line 76, in find_win32_generator
try_cmake(cmake_dir, build_dir, generator)
File "C:\Users\Se_320_Gb\AppData\Local\Temp\pip-install-_v76h2mu\llvmlite_0c956b9ff442433e8d48ac4e37563a11\ffi\build.py", line 28, in try_cmake
subprocess.check_call(['cmake', '-G', generator, cmake_dir])
File "c:\users\se_320_gb\appdata\local\programs\python\python39\lib\subprocess.py", line 368, in check_call
retcode = call(*popenargs, **kwargs)
File "c:\users\se_320_gb\appdata\local\programs\python\python39\lib\subprocess.py", line 349, in call
with Popen(*popenargs, **kwargs) as p:
File "c:\users\se_320_gb\appdata\local\programs\python\python39\lib\subprocess.py", line 947, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "c:\users\se_320_gb\appdata\local\programs\python\python39\lib\subprocess.py", line 1416, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
error: command 'c:\\users\\se_320_gb\\appdata\\local\\programs\\python\\python39\\python.exe' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\se_320_gb\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Se_320_Gb\\AppData\\Local\\Temp\\pip-install-_v76h2mu\\llvmlite_0c956b9ff442433e8d48ac4e37563a11\\setup.py'"'"'; __file__='"'"'C:\\Users\\Se_320_Gb\\AppData\\Local\\Temp\\pip-install-_v76h2mu\\llvmlite_0c956b9ff442433e8d48ac4e37563a11\\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\Se_320_Gb\AppData\Local\Temp\pip-record-phjgzn90\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\se_320_gb\appdata\local\programs\python\python39\Include\llvmlite' Check the logs for full command output.
我尝试卸载然后重新安装 PyCharm 和 python 但这些不起作用
我认为问题与环境变量有关
我正在使用 python 版本 3.9.1 和 PyCharm 版本 2020.3.1,如果需要任何其他信息,请询问我
答案 0 :(得分:1)