I want to install tensorflow to use Keras LSTM I installed Keras, and i import this lines to my code.
JavaScript
x
6
1
from keras.callbacks import LambdaCallback
2
from keras.models import Sequential
3
from keras.layers import Dense, Activation
4
from keras.layers import LSTM
5
from keras.optimizers import RMSprop
6
Error is when runnig the code:
JavaScript
1
2
1
No module named 'tensorflow'
2
Cmd error when i write “pip install tensorflow” :
JavaScript
1
3
1
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
2
ERROR: No matching distribution found for tensorflow
3
Pip version is 19.3 , python version 3.7
Advertisement
Answer
On Windows, you must use Python 3.7.6 (64 bits) (or later version, provided it is 64-bits) to install tensorflow:
JavaScript
1
2
1
C:Program FilesPython-3.7.6-x64> python.exe -m pip install --user tensorflow
2
Unfortunately, the 32-bit version is not supported by tensorflow and will give you that nasty error:
Could not find a version that satisfies the requirement tensorflow (from versions: none) ERROR: No matching distribution found for tensorflow
A few important notes:
- Install Microsoft Visual C++ Redistributable packages for x64 (2015, 2017, 2019).
- If you have previously installed Python 3.7 for x86, uninstall it from your system and also delete the directory where the x86 packages were stored to avoid a conflict with the new x64 packages that will be placed there. In my machine they were stored at
C:\Users\karlphillip\AppData\Roaming\Python\Python37\site-packages
. - Finally, install Python 3.7.6 (x64) and upgrade pip with
python -m pip install --user --upgrade pip
. - Now, simply install tensorflow:
python -m pip install --user tensorflow