我一直在遵循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的安装不正确

最佳答案

我忘了回答。我解决了这个问题,因为根本的问题是Apple版本(请参阅this对类似问题的答案)。

TLDR:

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


然后按照给出的指南here

关于python - 在OSX上安装llvmpy,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22624703/

10-13 05:33