简体   繁体   English

ModuleNotFoundError:没有名为“numpy.core._multiarray_umath”的模块(安装 TensorFlow 时)

[英]ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' (While installing TensorFlow)

I am following this tutorial to install TensorFlow( https://www.tensorflow.org/install/pip ), but in the last command:我正在按照本教程安装 TensorFlow( https://www.tensorflow.org/install/pip ),但在最后一个命令中:

python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"

I get this result:我得到这个结果:

ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ImportError: numpy.core.multiarray failed to import

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 980, in _find_and_load
SystemError: <class '_frozen_importlib._ModuleLockManager'> returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-02-16 12:56:50.178364: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr

I have already installed numpy as you can see:如您所见,我已经安装了numpy

pip3 install numpy
Requirement already satisfied: numpy in c:\programdata\anaconda3\lib\site-packages (1.15.4)

So why do I get this error message and how can I fix it on Windows 10?那么为什么我会收到此错误消息以及如何在 Windows 10 上修复它?

I upgraded numpy to 1.16.1 version and tried again the above command:我将numpy升级到1.16.1版本并再次尝试上述命令:

python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"

and got this new result:并得到了这个新结果:

2019-02-16 13:12:40.611105: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
tf.Tensor(-1714.2305, shape=(), dtype=float32)

升级numpy解决报错

pip install numpy --upgrade

我有 numpy 1.16.2版本但它给出了同样的错误然后我尝试安装1.16.1并且它对我1.16.1

You need to force the upgrade numpy to the latest version.您需要强制将 numpy 升级到最新版本。

pip install 'numpy==1.16' --force-reinstall

Hope this helps.希望这可以帮助。

通过运行它来确保您使用的是 python 3.x

python3 -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"

I just upgraded my numpy from 1.14.0 to 1.17.0 by the following command on Ubuntu 18.10.我刚刚在 Ubuntu 18.10 上通过以下命令将我的 numpy 从 1.14.0 升级到 1.17.0。

sudo python3.5 -m pip install numpy --upgrade须藤 python3.5 -m pip install numpy --upgrade

No import error then.然后没有导入错误。

试试这个: pip install --upgrade --force-reinstall numpy

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TensorFlow - ModuleNotFoundError:没有名为“numpy.core._multiarray_umath”的模块 - TensorFlow - ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' ModuleNotFoundError:matplotlib 导入时没有名为“numpy.core._multiarray_umath”的模块 - ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' on matplotlib import kivy 中没有名为“numpy.core._multiarray_umath”的模块 - No module named 'numpy.core._multiarray_umath' in kivy Windows VS 代码找不到 numpy 模块,即使它已安装(ModuleNotFoundError: No module named 'numpy.core._multiarray_umath') - Windows VS Code can't find numpy Module even though it is installed (ModuleNotFoundError: No module named 'numpy.core._multiarray_umath') 无法安装 numpy。 没有名为“numpy.core._multiarray_umath”的模块 - Unable to Install numpy. No module named 'numpy.core._multiarray_umath' 发生异常:ImportError &quot;No module named &#39;numpy.core._multiarray_umath&#39;&quot; - Exception has occurred: ImportError "No module named 'numpy.core._multiarray_umath'" pd.read_hdf抛出“无法将此数组的WRITABLE标志设置为True”和“没有名为“ numpy.core._multiarray_umath”的模块” - pd.read_hdf throws 'cannot set WRITABLE flag to True of this array' and 'No module named 'numpy.core._multiarray_umath' 当我安装 tensorflow 时,我收到以下错误 ImportError: cannot import name '_set_madvise_hugepage' from 'numpy.core._multiarray_umath' - when I installed tensorflow I get the following error ImportError: cannot import name '_set_madvise_hugepage' from 'numpy.core._multiarray_umath' ModuleNotFoundError:为anaconda3安装Keras时,没有名为“ tensorflow”的模块 - ModuleNotFoundError: No module named 'tensorflow' while installing Keras for anaconda3 当使用matplotlib时,我得到`没有名为_multiarray_umath的模块 - I get `No module named _multiarray_umath` when using matplotlib
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM