Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When importing tensorflow, I get the following error: No module named 'numpy.core._multiarray_umath'

I have installed Ancaconda3 and Tensorflow. When I try to import Tensorflow in python shell I receive the following error:

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 "", line 980, in _find_and_load SystemError: returned a result with an error set ImportError: numpy.core._multiarray_umath failed to import ImportError: numpy.core.umath failed to import

I am not sure what the problem is as numpy is installed on my system and can be successfully imported in python. I am using Windows10.

Thanks in advance.

like image 478
Dick Avatar asked Feb 13 '19 08:02

Dick


People also ask

How do I fix ModuleNotFoundError No module named NumPy?

The Python "ModuleNotFoundError: No module named 'numpy'" occurs when we forget to install the numpy module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install numpy command.

How do I add NumPy to Python?

There are two ways to install numpy: Install the binary (pre-compiled) version using pip. Compile it from source code, and then install it.

How do I check NumPy version in Anaconda prompt?

Make sure you are using the Anaconda prompt, as the conda command only works in an Anaconda environment, and type conda list numpy . The result will show the version of numpy and associated packages.


2 Answers

I also had the same issue. It got resloved once i upgraded the numpy from 1.15.4 to 1.16.1.

If you're using pip: pip install numpy --upgrade

Numpy that came with Anaconda3 is of version 1.15.4. so i upgraded and it worked.


Side note: if you're also using scikit-image in your script, be aware that numpy 1.16.3 has a conflict with old versions of scikit-image (e.g. you may get ImportError: cannot import name '_validate_lengths'). In that case, pip install --upgrade scikit-image from terminal solved the issue for me.

Hope it helps!!

like image 77
Modem Rakesh goud Avatar answered Sep 20 '22 11:09

Modem Rakesh goud


You can use two options in python 3.6

  1. Install

py pip -m install numpy==1.14.5

  1. Upgrade

py pip install numpy --upgrade

Note: the version most recently is 1.14.5

like image 33
Jorge Santos Neill Avatar answered Sep 18 '22 11:09

Jorge Santos Neill