简体   繁体   中英

Issue of installing tensorflow 1.15 with python 3.7.7

I am trying to install tensorflow 1.15, and it's installed well. When I run again pip install tensorflow==1.15 it shows me the below screen:

C:\Users\Fatima>pip install tensorflow==1.15
Requirement already satisfied: tensorflow==1.15 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (1.15.0)
Requirement already satisfied: tensorflow-estimator==1.15.1 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (1.15.1)
Requirement already satisfied: keras-applications>=1.0.8 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (1.0.8)
Requirement already satisfied: grpcio>=1.8.6 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (1.37.1)
Requirement already satisfied: termcolor>=1.1.0 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (1.1.0)
Requirement already satisfied: six>=1.10.0 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (1.15.0)
Requirement already satisfied: keras-preprocessing>=1.0.5 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (1.1.2)
Requirement already satisfied: gast==0.2.2 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (0.2.2)
Requirement already satisfied: absl-py>=0.7.0 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (0.12.0)
Requirement already satisfied: opt-einsum>=2.3.2 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (3.3.0)
Requirement already satisfied: wrapt>=1.11.1 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (1.12.1)
Requirement already satisfied: numpy<2.0,>=1.16.0 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (1.20.2)
Requirement already satisfied: protobuf>=3.6.1 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (3.15.8)
Requirement already satisfied: astor>=0.6.0 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (0.8.1)
Requirement already satisfied: wheel>=0.26 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (0.36.2)
Requirement already satisfied: tensorboard<1.16.0,>=1.15.0 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (1.15.0)
Requirement already satisfied: google-pasta>=0.1.6 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorflow==1.15) (0.2.0)
Requirement already satisfied: h5py in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from keras-applications>=1.0.8->tensorflow==1.15) (3.2.1)
Requirement already satisfied: markdown>=2.6.8 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorboard<1.16.0,>=1.15.0->tensorflow==1.15) (3.3.4)
Requirement already satisfied: setuptools>=41.0.0 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorboard<1.16.0,>=1.15.0->tensorflow==1.15) (41.2.0)
Requirement already satisfied: werkzeug>=0.11.15 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from tensorboard<1.16.0,>=1.15.0->tensorflow==1.15) (1.0.1)
Requirement already satisfied: importlib-metadata in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from markdown>=2.6.8->tensorboard<1.16.0,>=1.15.0->tensorflow==1.15) (4.0.1)
Requirement already satisfied: cached-property in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from h5py->keras-applications>=1.0.8->tensorflow==1.15) (1.5.2)
Requirement already satisfied: typing-extensions>=3.6.4 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from importlib-metadata->markdown>=2.6.8->tensorboard<1.16.0,>=1.15.0->tensorflow==1.15) (3.10.0.0)
Requirement already satisfied: zipp>=0.5 in c:\users\Fatima\appdata\local\programs\python\python37\lib\site-packages (from importlib-metadata->markdown>=2.6.8->tensorboard<1.16.0,>=1.15.0->tensorflow==1.15) (3.4.1)

That means that tensorflow is installed, right? The python I am using is V3.7.7

I use Pycharm to run the following code as test:

import tensorflow as tf
print(tf.__version__)

It gives me an error as follows:

Traceback (most recent call last):
  File "C:/Python394/for_trials.py", line 1, in <module>
    import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'

It's like it couldn't identify the tensorflow, or the python is not compatible with Tf1. However, following the guide, that python 3.7 and older are compatible with Tf1.

Could you please help me in solving that issue to install Tf1?

thank you

The problem is that tensorflow is well installed in your machine but in which environment? for pycharm to see tensorflow, tensorflow must be installed in the same environment that pycharm uses to execute code. But if for example your pycharm is configured to execute codes in a virtual environment and tensorflow is installed in anaconda, there is has no way it works. So the simple solution that you can do is to change the environment of pycham to the environment where tensorflow is installed

tu change l'interpréteur comme ceci tu change l'interpréteur comme ceci

tu change l'interpréteur comme ceci tu change l'interpréteur comme ceci

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM