Incompatible version of Numpy after installing Tensorflow on anconda virtual virtual environment

Viewed 321

I created an virtual virtual environment and immediately installed Tensorflow with the following command:

conda install tensorflow

After that, I changed the enviornment in Pycharm to the environment i created(python version 3.8), and tried to run this code:

import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers


tl = tf.keras.layers.LSTM(6)

I recieved the following errors:

ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/איתן רוזטי/PycharmProjects/Neural_Network/rnn.py", line 2, in <module>
    import tensorflow as tf
  File "C:\Users\איתן רוזטי\AppData\Local\conda\conda\envs\neural_network\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\איתן רוזטי\AppData\Local\conda\conda\envs\neural_network\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module>
    from tensorflow.python.eager import context
  File "C:\Users\איתן רוזטי\AppData\Local\conda\conda\envs\neural_network\lib\site-packages\tensorflow\python\eager\context.py", line 29, in <module>
    import numpy as np
  File "C:\Users\איתן רוזטי\AppData\Local\conda\conda\envs\neural_network\lib\site-packages\numpy\__init__.py", line 140, in <module>
    from . import core
  File "C:\Users\איתן רוזטי\AppData\Local\conda\conda\envs\neural_network\lib\site-packages\numpy\core\__init__.py", line 48, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "C:\Users\איתן רוזטי\AppData\Local\conda\conda\envs\neural_network\python.exe"
  * The NumPy version is: "1.19.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.

What can i do to fix that and run the code?

I found the solution: I uninstalled Numpy(version 1.19.2) and installed a lower version (version 1.18.1) with the following comands:

pip uninstall numpy
pip install numpy==1.18.1
1 Answers

Well, it might be possible that you haven't set up the System Environment Variable PATH:

here are the Paths you can add.

C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Scripts\
C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Library\
C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Library\bin\
C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Library\mingw-w64\bin\
Related