Print TensorFlow Version

Find out which version of TensorFlow is installed in your system by printing the TensorFlow version

Find out which version of TensorFlow is installed in your system by printing the TensorFlow version

Video Transcript


This video will show you how to find out which version of TensorFlow is installed in your system by printing the TensorFlow version.


First, we assume that you have already installed TensorFlow into your system.


If you have installed TensorFlow correctly, then you will be able to import the package while in a Python interpreter session.

import tensorflow as tf

So you can do the import TensorFlow as tf.

And it worked.

There were no errors.


Next, let’s import a fake module or package to show you what error you would get.


So we import superfakeunicorn.

import superfakeunicorn

When we evaluate it, we see that we get ModuleNotFoundError: No module named ‘superfakeunicorn’.


So now that we know that we have TensorFlow installed correctly, let’s figure out which version of TensorFlow is installed in our system by printing tf – remember that we imported TensorFlow as tf – so (tf.__version__).

print(tf.__version__)

When we evaluate that, we see that the TensorFlow package that is currently installed and being used in our Python interpreter session is TensorFlow 1.10.0.


Perfect - We were able to find out which version of TensorFlow is installed in our system by printing the TensorFlow version.

Receive the Data Science Weekly Newsletter every Thursday

Easy to unsubscribe at any time. Your e-mail address is safe.