UsageError: Line magic function `%tensorflow_version` not found

Jupyter notebook comes with a set of magic functions, but %tensorflow_version is not one of them. The magic command

%tensorflow_version X.X

is only available in Google Colab notebooks, not Jupyter notebooks.


This code

%tensorflow_version 1.x

...is a "magic" command ("magic spell") in Google Colab that instructs the Colab environment to use the newest stable release of Tensorflow version 1. For you to get the code to work on your own Jupyter notebook, you'll need to install Tensorflow locally. There are a few ways:

command line, installing a particular version:

pip install tensorflow==1.15.0

or in your Jupyter notebook, itself:

import sys 
!{sys.executable} -m pip install tensorflow==1.15.0
# !{sys.executable} -m pip install --user tensorflow==1.15.0. # you may need '--user' based on your environment