Python问题:ImportError: No module named numba

        numba 是一款可以将 python 函数编译为机器代码的JIT编译器,经过 numba 编译的python 代码(仅限数组运算),其运行速度可以接近 C 或 FORTRAN 语言。python 之所以慢,是因为它是靠 CPython 编译的,numba 的作用是给 python 换一种编译器。    
        numba可以基于llvm动态生成优化代码,提高python的执行效率,只需要给python代码加上修饰器就好了。

        如果遇到ImportError: No module named numba这样的问题,安装numba即可,而安装numba依赖于llvmlite,因此解决方案如下:

$ sudo pip install llvmlite==0.31.0
$ sudo -H pip install numba

         安装过程截图如下:

        这样安装numba就不会出错了。
        记得添加sudo,不然会报错:Consider using the `--user` option or check the permissions.

参考网址

building wheel for llvmlite(setup.py) ...error (librosa包安装问题)

猜你喜欢

转载自blog.csdn.net/JIEJINQUANIL/article/details/106414072
今日推荐