11

I'm new to programming and following a course where I must install Tensorflow. The issue is that I'm using Python 3.8 which I understand isn't supported by Tensorflow.

I've downloaded Python 3.6 but I don't know how to switch this as my default version of python.

Would it be best to set up a venv using python 3.6 for my program and install Tensorflow in this venv?

Also, I using Windows and Powershell.

Seanny123
  • 8,776
  • 13
  • 68
  • 124
Matthew Gilshnan
  • 131
  • 1
  • 1
  • 4
  • 1
    I would recommend you to use a program called [anaconda](https://www.anaconda.com/), which allows you to work with different versions of python and makes the installation of libraries as a tensorflow extremely easy. – Danielmagox Dec 12 '19 at 10:07

7 Answers7

22

Tensorflow is only supported until python 3.7 as of now. You can check it here: https://www.tensorflow.org/install/pip

But there is a way to install it on Python3.8, just run the below command that will do your job:

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

This command work on mac and windows both, I haven't tested on Linux.

Aashish Kumar
  • 2,771
  • 3
  • 28
  • 43
  • Running this command on my Mac gives this error: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named pip Any suggestions? – twhale Feb 03 '20 at 22:19
  • First of all you have to install pip on your mac then try this command. – Aashish Kumar Feb 07 '20 at 17:19
0

You should always use venv because by default every project on your system will use these same directories to store and retrieve site packages (third party libraries). At first glance, this may not seem like a big deal, and it isn’t really, for system packages (packages that are part of the standard Python library), but it does matter for site packages.

Consider the following scenario where you have two projects: ProjectA and ProjectB, both of which have a dependency on the same library, ProjectC. The problem becomes apparent when we start requiring different versions of ProjectC. Maybe ProjectA needs v1.0.0, while ProjectB requires the newer v2.0.0.

You can also take a look at anaconda, it’s the most populasr data sciencie platform and will be easy for you install tensorflow and jupiter notebook in just 2 clicks. Anaconda

Josep Bové
  • 626
  • 1
  • 8
  • 22
0

Uninstall all your python versions and use the latest anaconda.

$ conda create --name tensorflow python=3.5

This way you create a virtual environment with python 3.5 which is supported by tensorflow.

So now you can install it.

$ activate tensorflow
(tensorflow) $ pip install tensorflow
MartinKondor
  • 412
  • 4
  • 14
0

it would have been nice if you would have the share the error screenshot though as per i got the case

tensorflow work in both 3.8 and 3.6 just you have to check that you have 64bit version not 32 bit

you can acess both version from thier respective folder no need to install a venv

0

If you don't want to use Anaconda or virtualenv, then actually multiple Python versions can live side by side. I use Python38 as my default and Python35 for TensorFlow until they release it for Python38. If you wish to use the "non-default" Python, just invoke with the full path of the python.exe (or create a shortcut/batch file for it). Python then will take care of using the correct Python libs for that version.

bennylp
  • 191
  • 2
  • 6
0

Worked on Python 3.8.2 (default, Mar 05 2020, 18:58:42) [GCC] on linux

pip3 install --upgrade tf-nightly
Dharman
  • 30,962
  • 25
  • 85
  • 135
nexoma
  • 275
  • 4
  • 10
0

Python Versions 3.5 - 3.8 are supported now.

You can verify on this page: https://www.tensorflow.org/install/pip

nights
  • 411
  • 3
  • 9