For those who don’t know, TensorFlow is an end-to-end open-source platform for machine learning built by Google. It has comprehensive libraries and community resources that allow anyone to build machine learning programs. When it comes to installing TensorFlow, it can be installed system-wide, in a Python virtual environment, as a Docker container, and other others. The most common way to install TensorFlow is via a Python virtual environment where multiple environments can be created and managed easily. If you’re a student or new user looking for a Linux system to start learning on, the easiest place to start is Ubuntu Linux OS. It’s a great Linux operating system for beginners and folks looking for easier Linux distribution to use. Ubuntu is an open-source Linux operating system that runs on desktops, laptops, servers, and other devices. To get started with installing TensorFlow, follow the steps below:

Install Python

Since using Python is the most popular way to run TensorFlow, let’s go ahead and install Python. By default, Python 3 comes with Ubuntu repositories. To find out which version of Python is installed on Ubuntu, run the commands below: That should display a similar line as below: With Python 3.6, you’ll probably want to create a virtual environment using its venv module. To install the python3-venv package that enables the venv module, run the commands below: That should enable Python virtual environment.

Create TensorFlow Directory

Now that you know the version of Python installed, continue below to create a directory for TensorFlow. To do that, run the commands below: Next, change into the directory you create and create a Python virtual environment. After creating the Python environment, run the commands below to activate it.

Install TensorFlow

Now that your environment is created and activated, use the steps below to install TensorFlow. To install the current release, which includes support for CUDA-enabled GPU cards (Ubuntu and Windows): A smaller CPU-only package is also available: To update TensorFlow to the latest version, add the –upgrade flag to the above commands. To verify if TensorFlow is installed, you can run the commands below: The command should output the version of TensorFlow installed. That tells you the version of TensorFlow installed. Deactivate Python Environment When you’re done with your Python environment, simply run the commands below to deactivate. That should delete the Python environment you created to run TensorFlow. For more about how to use TensorFlow, please visit its site to learn more. https://www.tensorflow.org/learn That should do it! Conclusion: This post shows students and new users how to install TensorFlow on Ubuntu 20.04 | 18.04. If you find any errors above, please use the comment form to report them. Thanks, You may also like the post below: