安装llvmlite报错解决:RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for

在安装llvmlite时遇到RuntimeError,提示llvm-config命令未找到。解决方法是确保LLVM正确安装并设置LLVM_CONFIG环境变量指向其路径,之后安装即可顺利完成。

晚上在安装llvmlite时报错:

zhang@debian:~$ pip3 install llvmlite==0.16.0
Collecting llvmlite==0.16.0
  Using cached https://files.pythonhosted.org/packages/23/c7/56d7c18564783f33206b3cb6ce861a8d681e8be1a124c5651145ce5aad0f/llvmlite-0.16.0.tar.gz
Building wheels for collected packages: llvmlite
  Running setup.py bdist_wheel for llvmlite ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-s7dyuobp/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/tmpsklqjxv1pip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  got version from file /tmp/pip-build-s7dyuobp/llvmlite/llvmlite/_version.py {'version': '0.16.0', 'full': '964cf1d6d725b000c769379a5efe11932fcfc551'}
  running build_ext
  /usr/bin/python3 /tmp/pip-build-s7dyuobp/llvmlite/ffi/build.py
  LLVM version... Traceback (most recent call last):
    File "/tmp/pip-build-s7dyuobp/llvmlite/ffi/build.py", line 105, in main_posix
      out = subprocess.check_output([llvm_config, '--version'])
    File "/usr/lib/python3.5/subprocess.py", line 316, in check_output
      **kwargs).stdout
    File "/usr/lib/python3.5/subprocess.py", line 383, in run
      with Popen(*popenargs, **kwargs) as process:
    File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
      restore_signals, start_new_session)
    File "/usr/lib/python3.5/subprocess.py", line 1282, in _execute_child
      raise child_exception_type(errno_num, err_msg)
  FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/tmp/pip-build-s7dyuobp/llvmlite/ffi/build.py", line 152, in <module>
      main()
    File "/tmp/pip-build-s7dyuobp/llvmlite/ffi/build.py", line 142, in main
      main_posix('linux', '.so')
    File "/tmp/pip-build-s7dyuobp/llvmlite/ffi/build.py", line 108, 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 '/usr/bin/python3' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for llvmlite
  Running setup.py clean for llvmlite
Failed to build llvmlite
Installing collected packages: llvmlite
  Running setup.py install for llvmlite ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-s7dyuobp/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-k5q48i8w-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    running install
    running build
    got version from file /tmp/pip-build-s7dyuobp/llvmlite/llvmlite/_version.py {'version': '0.16.0', 'full': '964cf1d6d725b000c769379a5efe11932fcfc551'}
    running build_ext
    /usr/bin/python3 /tmp/pip-build-s7dyuobp/llvmlite/ffi/build.py
    LLVM version... Traceback (most recent call last):
      File "/tmp/pip-build-s7dyuobp/llvmlite/ffi/build.py", line 105, in main_posix
        out = subprocess.check_output([llvm_config, '--version'])
      File "/usr/lib/python3.5/subprocess.py", line 316, in check_output
        **kwargs).stdout
      File "/usr/lib/python3.5/subprocess.py", line 383, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
        restore_signals, start_new_session)
      File "/usr/lib/python3.5/subprocess.py", line 1282, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/tmp/pip-build-s7dyuobp/llvmlite/ffi/build.py", line 152, in <module>
        main()
      File "/tmp/pip-build-s7dyuobp/llvmlite/ffi/build.py", line 142, in main
        main_posix('linux', '.so')
      File "/tmp/pip-build-s7dyuobp/llvmlite/ffi/build.py", line 108, 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 '/usr/bin/python3' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-s7dyuobp/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-k5q48i8w-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-s7dyuobp/llvmlite/

这个报错是因为找不到llvm-config这个命令:

alias llvm-config="llvm-config-3.9"
export LLVM_CONFIG="/usr/bin/llvm-config-3.9"

然后再安装就不会报错了:

zhang@debian:~$ pip3 install llvmlite==0.16.0
Collecting llvmlite==0.16.0
  Using cached https://files.pythonhosted.org/packages/23/c7/56d7c18564783f33206b3cb6ce861a8d681e8be1a124c5651145ce5aad0f/llvmlite-0.16.0.tar.gz
Building wheels for collected packages: llvmlite
  Running setup.py bdist_wheel for llvmlite ... done
  Stored in directory: /home/zhang/.cache/pip/wheels/2a/c0/a5/f0d4dc24ba9076d15b0797f84e3fc3e9a6280b56c111f0d6a2
Successfully built llvmlite
Installing collected packages: llvmlite
Successfully installed llvmlite-0.16.0

Collecting llvmlite<0.32.0,>=0.31.0dev0 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/17/fc/da81203725cb22d53e4f819374043bbfe3327831f3cb4388a3c020d7a497/llvmlite-0.31.0.tar.gz (110 kB) Requirement already satisfied: setuptools in /home/huxin/anaconda3/lib/python3.9/site-packages (from numba==0.48.0) (56.1.0) Building wheels for collected packages: llvmlite Building wheel for llvmlite (setup.py) ... error ERROR: Command errored out with exit status 1: command: /home/huxin/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-4p6v4tbp cwd: /tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ Complete output (26 lines): running bdist_wheel /home/huxin/anaconda3/bin/python /tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ffi/build.py LLVM version... Traceback (most recent call last): File "/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ffi/build.py", line 105, in main_posix out = subprocess.check_output([llvm_config, '--version']) File "/home/huxin/anaconda3/lib/python3.9/subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/home/huxin/anaconda3/lib/python3.9/subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "/home/huxin/anaconda3/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/home/huxin/anaconda3/lib/python3.9/subprocess.py", line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ffi/build.py", line 168, in <module> main() File "/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ffi/build.py", line 158, in main main_posix('linux', '.so') File "/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ffi/build.py", line 107, in main_posix raise RuntimeError("%s failed executing, please point LLVM_CONFIG " RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config error: command '/home/huxin/anaconda3/bin/python' failed with exit code 1 ---------------------------------------- ERROR: Failed building wheel for llvmlite Running setup.py clean for llvmlite Failed to build llvmlite Installing collected packages: llvmlite, numba Attempting uninstall: llvmlite Found existing installation: llvmlite 0.38.0 Uninstalling llvmlite-0.38.0: Successfully uninstalled llvmlite-0.38.0 Running setup.py install for llvmlite ... error ERROR: Command errored out with exit status 1: command: /home/huxin/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0xp2acyx/install-record.txt --single-version-externally-managed --compile --install-headers /home/huxin/anaconda3/include/python3.9/llvmlite cwd: /tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ Complete output (29 lines): running install running build got version from file /tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/llvmlite/_version.py {'version': '0.31.0', 'full': 'fe7d985f6421d87f613bd414479d29d912771562'} running build_ext /home/huxin/anaconda3/bin/python /tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ffi/build.py LLVM version... Traceback (most recent call last): File "/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ffi/build.py", line 105, in main_posix out = subprocess.check_output([llvm_config, '--version']) File "/home/huxin/anaconda3/lib/python3.9/subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/home/huxin/anaconda3/lib/python3.9/subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "/home/huxin/anaconda3/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/home/huxin/anaconda3/lib/python3.9/subprocess.py", line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ffi/build.py", line 168, in <module> main() File "/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ffi/build.py", line 158, in main main_posix('linux', '.so') File "/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/ffi/build.py", line 107, in main_posix raise RuntimeError("%s failed executing, please point LLVM_CONFIG " RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config error: command '/home/huxin/anaconda3/bin/python' failed with exit code 1 ---------------------------------------- Rolling back uninstall of llvmlite Moving to /home/huxin/anaconda3/lib/python3.9/site-packages/llvmlite from /home/huxin/anaconda3/lib/python3.9/site-packages/~lvmlite Moving to /home/huxin/anaconda3/lib/python3.9/site-packages/llvmlite-0.38.0-py3.9.egg-info from /home/huxin/anaconda3/lib/python3.9/site-packages/~lvmlite-0.38.0-py3.9.egg-info ERROR: Command errored out with exit status 1: /home/huxin/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fji4b7f3/llvmlite_2fba7ae59d6540769239538c32752489/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0xp2acyx/install-record.txt --single-version-externally-managed --compile --install-headers /home/huxin/anaconda3/include/python3.9/llvmlite Check the logs for full command output.
07-26
评论 10
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值