Would you like to learn how to install the Python virtual environment on Ubuntu Linux? In this tutorial, we are going to show you all the steps required to install the virtual environment of Python on Ubuntu Linux.

• Ubuntu 18.04
• Ubuntu 19.10
• Ubuntu 20.04
• Python 3
• Python 2

Ubuntu Playlist:

On this page, we offer quick access to a list of videos related to Ubuntu Linux.

Don't forget to subscribe to our youtube channel named FKIT.

Ubuntu Related Tutorial:

On this page, we offer quick access to a list of tutorials related to Ubuntu linux.

Tutorial Ubuntu - Installing the Python 3 virtual environment

Install the required packages.

Copy to Clipboard

Create a directory to store the Python virtual environment projects.

Copy to Clipboard

Create a Python virtual environment.

Copy to Clipboard

Verify the content of the virtual environment directory.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Start using the Python 3 virtual environment.

Copy to Clipboard

The command line prompt should change.

Copy to Clipboard

Verify the Python version being used in the virtual environment.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Verify the absolute path to the Python command.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Verify the PIP version being used in the virtual environment.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Install the desired libraries in the Python virtual environment.

Copy to Clipboard

In our example, we used the PIP command to install the ART library.

Start a Python prompt within the virtual environment.

Copy to Clipboard

Test the Python library installed.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Stop the Python virtual environment.

Copy to Clipboard

Keep in mind that Python libraries installed inside the virtual environment were not installed outside the virtual environment.

Congratulations! You have finished the Python virtual environment installation on Ubuntu Linux.

Tutorial Ubuntu - Installing the Python 2 virtual environment

Install the required packages.

Copy to Clipboard

Install the PIP package for Python 2.

Copy to Clipboard

Install the VIRTUALENV package for Python 2.

Copy to Clipboard

Create a directory to store the Python virtual environment projects.

Copy to Clipboard

Create a Python virtual environment.

Copy to Clipboard

Verify the content of the virtual environment directory.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Start using the Python 2 virtual environment.

Copy to Clipboard

The command line prompt should change.

Copy to Clipboard

Verify the Python version being used in the virtual environment.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Verify the absolute path to the Python command.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Verify the PIP version being used in the virtual environment.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Install the desired libraries in the Python virtual environment.

Copy to Clipboard

In our example, we used the PIP command to install the ART library.

Start a Python 2 prompt within the virtual environment.

Copy to Clipboard

Test the Python library installed.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Stop the Python 2 virtual environment.

Copy to Clipboard

Keep in mind that Python libraries installed inside the virtual environment were not installed outside the virtual environment.

Congratulations! You have finished the Python 2 virtual environment installation on Ubuntu Linux.