Repository navigation
Closed
Labels
Description
I just installed TensorFlow, Keras in anaconda3.
C:\conda create --name neuralnets python=3.7
C:\activate neuralnets
(neuralnets) C:\conda install theano
(neuralnets) C:\conda install mingw libpython
(neuralnets) C:\pip install tensorflow
(neuralnets) C:\pip install keras
Reproducing code example:
Executed this command:
(neuralnets) C:\python -c "from keras import backend; print(backend._BACKEND)"
Got the following error:
Traceback (most recent call last):
File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py", line 16, in <module>
from . import multiarray
File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\multiarray.py", line 12, in <module>
from . import overrides
File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Z0035HPP\AppData\Local\Continuum\anaconda3\envs\neuralnets\lib\site-packages\keras\__init__.py", line 3, in <module>
from . import utils
File "C:\Users\Z0035HPP\AppData\Local\Continuum\anaconda3\envs\neuralnets\lib\site-packages\keras\utils\__init__.py", line 2, in <module>
from . import np_utils
File "C:\Users\Z0035HPP\AppData\Local\Continuum\anaconda3\envs\neuralnets\lib\site-packages\keras\utils\np_utils.py", line 6, in <module>
import numpy as np
File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py", line 47, in <module>
raise ImportError(msg)
ImportError:
import numpy as np
<< your code here >>Error message:
Numpy/Python version information:
Can someone please help? I am new to using keras and tensorflow. I am using it for a class I am taking this semester.
Thanks
Reacted by Nagi Teramo
Activity
mattip commentedon Feb 16, 2019
Probably a duplicate of #12957 due to ContinuumIO/anaconda-issues#10628. Copied comment from the duplicate issue:
There is a difference between the location of the extra support libraries supplied with anaconda and those supplied with stock numpy that you get from
pip install. This requires adjustments to thePATHvariable. Perhaps thePATHadjustments are failing at import. Does thesite-packages\numpy\.libsdirectory exist and does it contain*.dllfiles?, If so, can you try to prepend that directory to yourPATHbefore running python:But in your case something is different, the path to numpy is missing a path separator:
C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core__init__.pyshould beC:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py. Is that a copy paste error?eric-wieser commentedon Feb 17, 2019
Just a github formatting issue, wrapping in
```made that go awayeric-wieser commentedon Feb 17, 2019
@bsathyan: You've not shown us the full error message. Can you paste the part that comes after the last
ImportErrortoo?bsathyan commentedon Feb 17, 2019
@eric-wieser attached below is the full error thread. Please do let me know if you need anything else.
Thanks :)
NishitHada commentedon Feb 19, 2019
I'm also facing the same issue.
mattip commentedon Feb 19, 2019
Did the fix suggested in the comment above help? This is a known problem with Anaconda.
NishitHada commentedon Feb 20, 2019
No, the path was already correct for me. And yes, this is a problem with anaconda. I used Virtual Environment for the same code and it ran quite well. Something is probably wrong with anaconda it seems.
rgommers commentedon Feb 22, 2019
pip install tensorflowpicked up numpy from PyPI. Trythat will probably fix things
mkurovski commentedon Feb 26, 2019
Hi,
I ran into the same issue and followed the advice to uninstall numpy using pip and installing it again with conda - but wasn't successful though.
However, I was trying to get
tensorboardup running with the following ImportError, not exactly the same, but maybe related:mjahmad commentedon Feb 26, 2019
Are you running tensorlow using a 3.6 python ? Tensorflow simply does not work with python 3.7.
I suggest you do this:
conda create --name tensorflow python=3.6
activate tensorflow
mkurovski commentedon Feb 26, 2019
Hi @mjahmad ,
Thanks for your reply. Indeed I am running Python
3.6.7in my environmentmkurovski commentedon Feb 26, 2019
OK, I got it now. Just to share in case there might be something useful in for you.
I uninstalled
tensorflowagain and only installed version1.12of tensorboard:pip install tensorboard==1.12Works now
kobilinux commentedon Feb 27, 2019
hi!
I succeeded in installing tensorflow in python3.7
pip uninstall numpy
pip install numpy
pip uninstall tensorflow
pip install tensorflow
avawda commentedon Mar 3, 2019
This solved my issue, thanks
marisbeautypalace commentedon Mar 13, 2019
Okay, sorry guy's I solved the problem. Maybe it will help you:
Update to the latest version of numpy :D
!pip install --upgrade numpykobilinux commentedon Mar 15, 2019
mattip commentedon Mar 15, 2019
Closing. Hopefully these problems have been solved on the Anaconda side, and some of the suggestions here seem suboptimal. The best solution seems to be
emmmarosewalker commentedon Mar 17, 2019
this worked for me, thanks
pawan431995 commentedon Mar 20, 2019
hello
i am getting same error while accessing tensorflow as bellow.
ModuleNotFoundError Traceback (most recent call last)
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
Solloution :- Update Numpy with latest version
setp to update numpy as follow
setp1 open cmd
setp2 write pip install numpy==leatest version and press Enter
example pip install numpy==1.16.2
evan-magnusson commentedon Apr 17, 2019
This worked for me as well. It looks like pip installing tensorflow added a second version of numpy
allanwenzs commentedon Apr 30, 2019
I had the same kind of error, I solved it by creating virtual environment using anaconda, then installing the necessary libraries, it worked.
Jairodub commentedon May 19, 2019
I had the same issue and somehow got past it by running
9lash commentedon Jun 9, 2019
Looks like this error is because of multiple packages not installed properly in your specific env. For me, jupyter notebook was not installed in that specific virtual environment. I followed the above comments:
And then the following fixed it:
Now when you open the jupyter notebook from the environment and write the following:
there are no errors.