调用entropy库时报错:numba.errors.UntypedAttributeError: Failed at nopython (nopython frontend)解决办法
最近想用python计算功率谱密度的熵,于是在网上查到了entropy这个库,包含计算熵的功能,再按照官网上的标准命令安装后,调用entropy库时报错了,错误信息如下
numba.errors.UntypedAttributeError: Failed at nopython (nopython frontend)
Unknown attribute 'reshape' of type Module(<module 'numpy' from 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\numpy\\__init__.py'>)
File "..\..\..\entropy\entropy\others.py", line 20
[1] During: typing of get attribute at d:\entropy\entropy\others.py (20)
找了好久的解决办法,终于在numba官网上解决了
解决办法如下:
首先进入到出错代码others.py中
在第九行有一行代码:
@jit('f8(f8[:])', nopython=True)
删除掉括号内的内容, 将这行代码修改为:
@jit()
大功告成~