Installing Tensorflow when Python 3.9 is installed on Path?
Solution 1
Try this command
python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
Solution 2
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
Solution 3
The following command should be work for python version 3.9: python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
Solution 4
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
Solution 5
For dealing with multiple Python Versions it is highly recommended to use virtual environments. It makes live much easier. For a detailed guide how to set them up read this: https://www.freecodecamp.org/news/manage-multiple-python-versions-and-virtual-environments-venv-pyenv-pyvenv-a29fb00c296f/
Shashank Walake
Updated on March 07, 2022Comments
-
Shashank Walake about 2 years
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.
-
Divyessh over 3 yearssource the path to the bin of python
-
Djib2011 over 3 yearswhich python do you want to install tensorflow for?
-
hoefling over 3 years
py -3.8 -m pip install tensorflow
-
danihelovij about 3 years@hoefling It works, thank you
-
usman mohammed almost 3 yearsuse this : stackoverflow.com/questions/64447565/…
-
-
Suthiro over 3 yearsI suppose it will use
python3.9
, isn't it? -
RobbieTheK over 3 yearsThis appears to be for Mac OS. I got this error on Fedora:
ImportError: /usr/local/lib/python3.9/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: invalid ELF header During handling of the above exception, another exception occurred:
-
EpixyCoder101 over 3 years@RobbieTheK that's odd.. seems to work on my Windows system.
-
brunocrt about 3 yearsthe last command worked for me because I was using Python 3.9 and will only work with the most recent version/builds of tensorflow (tf-nightly) thanks for the help!