Python安装LLVMLite报错及解决方案

问题背景

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

我最终是通过这个方法解决的,大家可以尝试下。

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值