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

Python 3.xNumpyTensorflowAnaconda

Python 3.x Problem Overview


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 " importlib._bootstrap>", 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.

Python 3.x Solutions


Solution 1 - Python 3.x

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!!

Solution 2 - Python 3.x

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

Solution 3 - Python 3.x

Kindly check whether you have installed the numpy package from pip. Because if you are running on conda evironment, then all packages need to be downloaded from there. Please use the below mentioned statement for this purpose

conda install -c anaconda numpy

Also make sure that the numpy version supports the Python version you are using.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDickView Question on Stackoverflow
Solution 1 - Python 3.xModem Rakesh goudView Answer on Stackoverflow
Solution 2 - Python 3.xJorge Santos NeillView Answer on Stackoverflow
Solution 3 - Python 3.xAnurag TumloorView Answer on Stackoverflow