1

I've just installed the latest version of Anaconda for Windows x64 with Python 3.8 and would like to add the tensorflow module.
According to this website, tensorflow 2.2.0 should be available.

However, my Anaconda only suggests tensorflow 2.1.0 and fails to install it because it's not compatible with Python 3.8.

How can I install tensorflow 2.2.0?

AMC
  • 2,642
  • 7
  • 13
  • 35
AnjaM
  • 2,941
  • 8
  • 39
  • 62
  • Does this answer your question? [How do I install the most recent Tensorflow (here: 2.2) on Windows when conda does not yet support it?](https://stackoverflow.com/questions/61357038/how-do-i-install-the-most-recent-tensorflow-here-2-2-on-windows-when-conda-do) – AMC Sep 28 '20 at 22:17

5 Answers5

5

If you installed tensorflow2.1 using Conda it automatically installed cudnn 7.6.5 and CUDA Toolkit 10.1.243. These are compatible with tensorflow 2.2. Then use pip to install tensorflow 2.2 as shown below

pip install tensorflow ==2.2.0

Conda at this time can only install tensorflow up to 2.1 that is why you have to use pip. pip does not automatically install cudnn or the Cuda toolkit but you already have them installed when you install version 2.1 with Conda. Otherwise you would have to go through a more complicated process to manually install cudnn and the toolkit. Some people have reported problems using python 3.8 with tensorflow. If you run into that create as seperate environment and install python 3.7, tensorflow 2.1 using conda, the tensorflow 2.2 using pip.

Gerry P
  • 7,662
  • 3
  • 10
  • 20
2

For this you might want to downgrade the Python to v3.7.
It is always a good practice to run TensorFlow in the lower-tested version of python. (Thats what I do.) And it just works as good as it would run in Python 3.8.

For this you might use the virtual environment using.
Create using:

conda create -n env_name python=3.7

And then just activate using:

conda activate env_name

And to install TensorFlow 2.2 just run:

pip install tensorflow==2.2.0

And once you are done, run:

conda deactivate
Harshit Ruwali
  • 1,040
  • 2
  • 10
  • 22
1

AnjaM,

I faced same problem. The other Conda page here still reports that their latest TF for Windows is 2.1.0. See screenshot below.

It may be a matter of days but I personally got tired of waiting and installed TF 2.3.0 with pip. 2.1.0 was throwing errors where 2.3.0 would work fine. Tips for installation:

  • do it in separate virtual environment
  • install all other needed packages fist and then install TF with pip
  • when updating other packages - don't let conda to downgrade TF. enter image description here
Poe Dator
  • 4,535
  • 2
  • 14
  • 35
1

I was having the same problem.
So, I installed tensorflow-gpu==2.2.0 with 'pip'.
then installed cudann = 7.6.5 and cudatoolkit==10.1.243

pip install tensorflow-gpu=2.2.0

conda install cudatoolkit==10.1.243
conda install cudnn==7.6.5
Rishang
  • 83
  • 1
  • 6
0

You need to add conda-forge as one of the package sources with this command:

conda config --add channels conda-forge

Once you do this, just update the package index and you'll be able to see the latest versions of all packages.

bansal98
  • 11
  • 3