使用pip升级到numba 0.16会导致错误

时间:2014-12-19 20:54:00

标签: python numba

我在Ubuntu 14.04,我的numba 0.15工作正常。

我跑了:

pip install --user --upgrade numba

升级到numba 0.16但现在当我尝试导入numba时出现以下错误:

~/.local/lib/python2.7/site-packages/numba/__init__.py in <module>()
      4 from __future__ import print_function, division, absolute_import
      5 import re
----> 6 from . import testing, decorators
      7 from ._version import get_versions
      8 from . import special, types, config

~/.local/lib/python2.7/site-packages/numba/decorators.py in <module>()
      5 import warnings
      6 from . import sigutils
----> 7 from .targets import registry
      8
      9 # -----------------------------------------------------------------------------

~/.local/lib/python2.7/site-packages/numba/targets/registry.py in <module>()
      1 from __future__ import print_function, division, absolute_import
      2
----> 3 from . import cpu
      4 from .descriptors import TargetDescriptor
      5 from .. import dispatcher, utils, typing

~/.local/lib/python2.7/site-packages/numba/targets/cpu.py in <module>()
      3 import sys
      4
----> 5 import llvmlite.llvmpy.core as lc
      6 import llvmlite.llvmpy.ee as le
      7 import llvmlite.binding as ll

ImportError: No module named llvmlite.llvmpy.core

这很奇怪,特别是因为我发现了这个:

  

问:我是否需要删除或更新llvmpy?

     <答:答:不,Numba根本不再使用llvmpy。

从这里: https://groups.google.com/a/continuum.io/forum/#!topic/numba-users/cGKF7MORo7o

任何想法?

2 个答案:

答案 0 :(得分:1)

可以找到答案here

Numba 0.16已经从使用llvmpy变为llvmlite作为LLVM库的包装器。 (我们也同时从LLVM 3.3升级到LLVM 3.5。)

此处描述了安装过程:

https://github.com/numba/numba/blob/master/README.md#custom-python-environments 以下新链接......

(另请注意,llvmlite(很像LLVM 3.5)需要构建C ++ 11编译器,这在较旧的发行版中很难实现。)

该行是:

https://github.com/numba/numba/blob/master/README.rst#custom-python-environments

答案 1 :(得分:1)

我的解决方案:

pip install numba==0.43.0
pip install llvmlite==0.32.1