运行 Raspberry Pi 3 上的 Numba Jit

Running Numba Jit on Raspberry Pi 3

我想 运行 一个带有 numba 的 python 程序。 我尝试使用以下方法安装 numba:

sudo apt install libblas-dev llvm python3-pip python3-scipy
sudo pip install llvmlite==0.15.0
sudo pip install numba==0.30.1

并搜索其他参考以安装 numba。 Numba 可以导入,但是当我 运行 使用 @jit 装饰器的程序时,它告诉:

Traceback (most recent call last):
File "Ambil_Data.py", line 12, in <module>
@njit#(fastmath=True)
File "/usr/local/lib/python2.7/dist-packages/numba/decorators.py", line 209, in njit
return jit(*args, **kws)
File "/usr/local/lib/python2.7/dist-packages/numba/decorators.py", line 151, in jit
return wrapper(pyfunc)
File "/usr/local/lib/python2.7/dist-packages/numba/decorators.py", line 167, in wrapper
**dispatcher_args)
File "/usr/local/lib/python2.7/dist-packages/numba/dispatcher.py", line 423, in __init__
self.targetctx = self.targetdescr.target_context
File "/usr/local/lib/python2.7/dist-packages/numba/targets/registry.py", line 54, in target_context
return self._toplevel_target_context
File "/usr/local/lib/python2.7/dist-packages/numba/utils.py", line 278, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/numba/targets/registry.py", line 38, in _toplevel_target_context
return cpu.CPUContext(self.typing_context)
File "/usr/local/lib/python2.7/dist-packages/numba/targets/base.py", line 232, in __init__
self.init()
File "/usr/local/lib/python2.7/dist-packages/numba/targets/cpu.py", line 42, in init
self._internal_codegen = codegen.JITCPUCodegen("numba.exec")
File "/usr/local/lib/python2.7/dist-packages/numba/targets/codegen.py", line 479, in __init__
self._init(self._llvm_module)
File "/usr/local/lib/python2.7/dist-packages/numba/targets/codegen.py", line 495, in _init
self._mpm = self._module_pass_manager()
File "/usr/local/lib/python2.7/dist-packages/numba/targets/codegen.py", line 535, in _module_pass_manager
dl.add_pass(pm)
AttributeError: 'TargetData' object has no attribute 'add_pass'

尝试更新 numballvmlite references from git numba

conda install -c numba llvmlite