在OSX上安装llvmpy

时间:2014-03-25 03:04:22

标签: python macos llvm

我一直关注this指南。不幸的是我不认为llvmpy正确安装(这是python的输出)。

>>> import numba
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/numba/__init__.py", line 5, in <module>
    from . import testing, decorators
  File "/Library/Python/2.7/site-packages/numba/decorators.py", line 7, in <module>
    from numba.targets import registry
  File "/Library/Python/2.7/site-packages/numba/targets/registry.py", line 3, in <module>
    from numba.targets import cpu
  File "/Library/Python/2.7/site-packages/numba/targets/cpu.py", line 4, in <module>
    import llvm.core as lc
  File "llvm/__init__.py", line 6, in <module>
    from llvmpy import extra
  File "llvmpy/extra.py", line 5, in <module>
    from llvmpy import capsule
  File "llvmpy/capsule.py", line 4, in <module>
    from llvmpy._capsule import (unwrap, has_ownership, downcast, wrap,
ImportError: No module named _capsule

执行python -c "import llvm"给出了与上面相同的错误(“没有名为_capsule的模块”)。有任何想法吗?安装llvm,llvmpy或numba时我没有收到错误,但很明显llvmpy没有正确安装

1 个答案:

答案 0 :(得分:1)

我忘了回答这个问题。我解决了这个问题,因为潜在的问题是Apple发布(请参阅this对类似问题的回答)。

TLDR:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

然后按照here

指南进行操作