Installing Tensorflow when Python 3.9 is installed on Path?

Viewed 52551

2 Versions of Python 3.9 and 3.8.6 are installed on Win 10. I Also want Tensorflow installed. But Pip recognises only Py 3.9 and hence does not installs tf locally. Is there a way out for this.

8 Answers

Try this command

python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl

python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl

This work with my python 3.9

This worked for me:

python3.8 -m pip install tensorflow

I think pip uses the latest python version, so you have to tell pip to install with python3.8 or use the beta version of tensorflow:

pip install tf-nightly

Change you're Environment variable from python 3.9 to python 3.8.6 .

1.search for environment variables in your pc see the pic --->. Environment variables

2.Now select environment variables option see pic --->. click on option

  1. Now edit the path of wanted python see pic --->. Edit

Your system is defaulting to python 3.9 because it is higher up in the system path list, so it is seen first. search for environment variable in windows then click on environment variable. Then under system variable, search for path and then move the python3.8 higher up than python3.9. Your system will now see 3.8 as default.

I did two things to make it work.

  1. After pip install tensorflow, restarted my VS Code
  2. Change the interpreter from 3.9 to 3.7, so it started installing ipython relevant packages and then changed it back to 3.9.
Related