python – 在OS X上安装Numba时出错

前端之家收集整理的这篇文章主要介绍了python – 在OS X上安装Numba时出错前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我无法在我的OS X系统上安装Numba(通过pip).

我在用着

> Python:2.7.11(Homebrew)
pip:8.1.1
> setuptools:20.6.7
> OS X:10.11.4(x86_64)
> Xcode:7.3
> Xcode CLT:7.3.0.0.1.1457485338
> Clang:7.3 build 703

并已经安装了先决条件(我认为)

brew install llvm
git clone https://github.com/numba/llvmlite
cd llvmlite
LLVM_CONFIG=/usr/local/opt/llvm/bin/llvm-config  python setup.py install
cd ..
rm -rf llvmlite

并试过

brew install llvm
brew link --force llvm  # later: brew unlink llvm
cd /usr/local/Cellar/llvm/X.X.X/include/llvm/Config/ # X.X.X = 3.6.2
ln -s llvm-config.h config.h

但是我呢

pip install numba

Failed building wheel for llvmlite
  Running setup.py clean for llvmlite
Successfully built numba
Failed to build llvmlite
Installing collected packages: llvmlite,numba
  Running setup.py install for llvmlite ... 
  [...]        
    error: option --single-version-externally-managed not recognized

    ----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools,tokenize;__file__='/private/var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/pip-build-MY_vtC/llvmlite/setup.py';exec(compile(getattr(tokenize,'open',open)(__file__).read().replace('\r\n','\n'),__file__,'exec'))" install --record /var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/pip-yoGGZY-record/install-record.txt --single-version-externally-managed --compile" Failed with error code 1 in /private/var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/pip-build-MY_vtC/llvmlite/

我很抱歉如何进行(没有Conda!),并想知道是否有一些简单的修复我失踪了.

解决方法

这对我来说有用(在OS X 10.11.4上使用Homebrew Python):
brew install homebrew/versions/llvm37 --with-rtti
git clone https://github.com/numba/llvmlite
cd llvmlite
LLVM_CONFIG=/usr/local/Cellar/llvm37/3.7.1/bin/llvm-config-3.7 python setup.py install
LLVM_CONFIG=/usr/local/Cellar/llvm37/3.7.1/bin/llvm-config-3.7 pip install numba
rm -rf llvmlite
原文链接:https://www.f2er.com/python/186352.html

猜你在找的Python相关文章