首页 > 解决方案 > 使用 pip 安装 turicreate 时出错 ...同时为 llvmlite 构建轮子

问题描述

我正在尝试使用安装 turicreate,pip install turicreate但收到以下错误。我不知道这个错误告诉我该怎么做。

评论中有人问我是否正确安装了 llvm。我该怎么做?

我尝试使用升级 Scipypip install --upgrade scipy但这没有帮助。

 Building wheel for llvmlite (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/harshavardhanhr/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/setup.py'"'"'; __file__='"'"'/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/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 /private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-wheel-e0QD2K
       cwd: /private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/
  Complete output (11 lines):
  running bdist_wheel
  /Users/harshavardhanhr/venv/bin/python /private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/ffi/build.py
  LLVM version... Traceback (most recent call last):
    File "/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/ffi/build.py", line 168, in <module>
      main()
    File "/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/ffi/build.py", line 162, in main
      main_posix('osx', '.dylib')
    File "/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/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 '/Users/harshavardhanhr/venv/bin/python' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for llvmlite
  Running setup.py clean for llvmlite
Failed to build llvmlite
ERROR: tensorflow 2.1.0 has requirement scipy==1.2.2; python_version < "3", but you'll have scipy 1.2.3 which is incompatible.
Installing collected packages: llvmlite, funcsigs, singledispatch, numba, resampy, mock, opt-einsum, h5py, keras-applications, gast, keras-preprocessing, pyasn1, rsa, cachetools, pyasn1-modules, google-auth, idna, chardet, urllib3, certifi, requests, werkzeug, oauthlib, requests-oauthlib, google-auth-oauthlib, futures, grpcio, absl-py, markdown, tensorboard, backports.weakref, tensorflow-estimator, functools32, astor, termcolor, wrapt, google-pasta, tensorflow, decorator, python-dateutil, pytz, pandas, turicreate
    Running setup.py install for llvmlite ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/harshavardhanhr/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/setup.py'"'"'; __file__='"'"'/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/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 /private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-record-Tq46YM/install-record.txt --single-version-externally-managed --compile --install-headers /Users/harshavardhanhr/venv/include/site/python2.7/llvmlite
         cwd: /private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/
    Complete output (14 lines):
    running install
    running build
    got version from file /private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/llvmlite/_version.py {'version': '0.32.0', 'full': '26059d238f4ba23dff74703dd27168591d889edd'}
    running build_ext
    /Users/harshavardhanhr/venv/bin/python /private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/ffi/build.py
    LLVM version... Traceback (most recent call last):
      File "/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/ffi/build.py", line 168, in <module>
        main()
      File "/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/ffi/build.py", line 162, in main
        main_posix('osx', '.dylib')
      File "/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/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 '/Users/harshavardhanhr/venv/bin/python' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/harshavardhanhr/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/llvmlite/setup.py'"'"'; __file__='"'"'/private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-install-00VSH7/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 /private/var/folders/8s/14fz39z503n7hqftf_yg1nyr0000gn/T/pip-record-Tq46YM/install-record.txt --single-version-externally-managed --compile --install-headers /Users/harshavardhanhr/venv/include/site/python2.7/llvmlite Check the logs for full command output.

标签: pythonpipllvmliteturi

解决方案


这是您错误的重要部分,隐藏在中间

RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config

这可能意味着你必须设置LLVM_CONFIG你的~/.bashrc,比如

export LLVM_CONFIG=/usr/local/opt/llvm@9/bin/llvm-config

完成后,记得来源它

source ~/.bashrc或者. ~/.bashrc


推荐阅读