问题背景
pip install llvmlite
报错:
Building wheels for collected packages: llvmlite
Building wheel for llvmlite (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/zhanghm/.virtualenvs/python27/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-M1772f/llvmlite/setup.py'"'"'; __file__='"'"'/tmp/pip-install-M1772f/llvmlite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-Vve0nB
cwd: /tmp/pip-install-M1772f/llvmlite/
Complete output (11 lines):
running bdist_wheel
/home/zhanghm/.virtualenvs/python27/bin/python /tmp/pip-install-M1772f/llvmlite/ffi/build.py
LLVM version... Traceback (most recent call last):
File "/tmp/pip-install-M1772f/llvmlite/ffi/build.py", line 168, in <module>
main()
File "/tmp/pip-install-M1772f/llvmlite/ffi/build.py", line 158, in main
main_posix('linux', '.so')
File "/tmp/pip-install-M1772f/llvmlite/ffi/build.py", line 109, in main_posix
"to the path for llvm-config" % (llvm_config,))
RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config
error: command '/home/zhanghm/.virtualenvs/python27/bin/python' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for llvmlite
Running setup.py clean for llvmlite
Failed to build llvmlite
DEPRECATION: Could not build wheels for llvmlite which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: llvmlite
Running setup.py install for llvmlite ... error
ERROR: Command errored out with exit status 1:
command: /home/zhanghm/.virtualenvs/python27/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-M1772f/llvmlite/setup.py'"'"'; __file__='"'"'/tmp/pip-install-M1772f/llvmlite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-uAOG6M/install-record.txt --single-version-externally-managed --compile --install-headers /home/zhanghm/.virtualenvs/python27/include/site/python2.7/llvmlite
cwd: /tmp/pip-install-M1772f/llvmlite/
Complete output (14 lines):
running install
running build
got version from file /tmp/pip-install-M1772f/llvmlite/llvmlite/_version.py {'version': '0.32.0', 'full': '26059d238f4ba23dff74703dd27168591d889edd'}
running build_ext
/home/zhanghm/.virtualenvs/python27/bin/python /tmp/pip-install-M1772f/llvmlite/ffi/build.py
LLVM version... Traceback (most recent call last):
File "/tmp/pip-install-M1772f/llvmlite/ffi/build.py", line 168, in <module>
main()
File "/tmp/pip-install-M1772f/llvmlite/ffi/build.py", line 158, in main
main_posix('linux', '.so')
File "/tmp/pip-install-M1772f/llvmlite/ffi/build.py", line 109, in main_posix
"to the path for llvm-config" % (llvm_config,))
RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config
error: command '/home/zhanghm/.virtualenvs/python27/bin/python' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/zhanghm/.virtualenvs/python27/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-M1772f/llvmlite/setup.py'"'"'; __file__='"'"'/tmp/pip-install-M1772f/llvmlite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-uAOG6M/install-record.txt --single-version-externally-managed --compile --install-headers /home/zhanghm/.virtualenvs/python27/include/site/python2.7/llvmlite Check the logs for full command output
解决方案
sudo apt-get install llvm-8
pip install numba==0.45.1 llvmlite==0.30.0
我最终是通过这个方法解决的,大家可以尝试下。