1

On Jupyter Notebook, with code tf.__version__ I'm getting '1.14.0'

But, on command prompt, with: pip show tensorflow i'm getting 2.2.0

I would like to use, Tensorflow 2.2.0 in Jupyter Notebook, how it can be done?

Caesar
  • 6,733
  • 4
  • 38
  • 44
kern
  • 145
  • 6
  • You may want to make sure that whatever version of python pip is running under and whatever version of python Jupyter is using are the same. (And if in doubt, ensure that the user is the same, too...) – Caesar Jun 15 '20 at 03:03
  • pip is running under python 3.8, and jupyter 3.7.6. I tried conda update, but python is still 3.7.6 – kern Jun 15 '20 at 03:26

2 Answers2

2

Thinking about it, the easiest way to make sure that the right version of TF is installed under the right version of python may be to install from inside a jupyter notebook with

import subprocess
import sys
subprocess.check_call([sys.executable, "-m",
    "pip", "install", "--user", "tensorflow==2.2.0"])

That should make sure it's available to the correct version of python.

(See https://stackoverflow.com/a/50255019/401059 on using pip from python.)

Caesar
  • 6,733
  • 4
  • 38
  • 44
0

You can do this to force it use the same version with the current Notebook kernel. But first you'd have to find the full path to your Kernel'spip Note that in the figure below, asv is the name of the conda environment that I created, make sure to change it to your defined name.

enter image description here

Long
  • 1,482
  • 21
  • 33