AttributeError: module 'numpy.co

2019-07-19  本文已影响0人  mmmmda

import theano 之后 出现   module 'numpy.core.multiarray' has no attribute 'get_ndarray_c_version' 

python - numpy AttributeError: with theano module 'numpy.core.multiarray' has no attribute _get_ndarray_c_version - Stack Overflow

This is a known bug presumably caused by changes introduced in NumPy. A fix for this was introduced in Theano v1.0.4. So, either you need to upgrade to at least that version of Theano, or downgrade NumPy to below v1.16.

stackoverflow 某大神的解释如上。

conda list 后查看了下  theano 版本为 1.0.3  ,输入 conda update theano 没有用。

numpy降版本不方便。

解决办法:

------------------------------------------------------------------------------------------------------------------

Just a moment...  下载对应的离线安装包

比如我的是win64 下载的是 win-64/theano-1.0.4-py27hc56fc5f_1000.tar.bz2  

到下载的文件夹 shift+右击 进入 powershell 

输入 :

conda install --use-local theano-1.0.4-py27hc56fc5f_1000.tar.bz2

------------------------------------------------------------------------------------------------------------------

上述方法会导致 prompt 闪退 

"Did not find VS in registry or in VS140COMNTOOLS env var - exiting"

具体修复方法 :

conda uninstall vs2015_win-64

python - Anaconda prompt closes immediately - the system was unable to find the specified registry key or value - Stack Overflow

新解决办法:

到    Anaconda3\pkgs\theano-1.0.3-py37_0\Lib\site-packages\theano\gof  文件夹下面,打开 cc.py 文件。

定位到1376行,注释掉

sig.append('NPY_ABI_VERSION=0x%X' %

        np.core.multiarray._get_ndarray_c_version())

如图:

Resolving "AttributeError: module 'numpy.core.multiarray' has no attribute '_get_ndarray_c_version'" on Python 3.7.2 using numpy 1.1.6 · Issue #20 · MichalDanielDobrzanski/DeepLearningPython35 · GitHub

python安装theano出现AttributeError错误解决办法 - 豌豆ip代理

上一篇下一篇

猜你喜欢

热点阅读