before the start
This tutorial has been tested on Ubuntu 18.04.4 Linux. In addition, I already have Python 3.8 installed on the system.
Step 1: Install Virtualenv module
First, you need to install Virtualenv Python modules on the system. Use pip3 virtualenv Python installation module. This will also other required modules installed on your system.
Step 2: Create a virtual environment
After the installation is complete. Let's create an isolated Python environment for your application.
Find your application needed to run Python binary position. In this tutorial, we use the most recent Python 3.8 installed. Which command to use to check the position of Python 3 binaries.
You can choose any other Python versions according to application requirements.
Then create isolated Python environment using the following command:
Output:
This command creates a local copy of your environment specific to this site. When working on the website, you should activate the local environment, to ensure that the correct version of the tools and software packages.
The third step: work in a virtual environment
After you create a virtual Python environment on Ubuntu systems. You need to activate it by running the following command.
Now, you will see the Python prompt isolation environment. Check the python binary position, use the following command:
Now, you use pip to install all the packages will be placed in a virtual environment project folder, install Python and global isolation.
Use pip3 mounting module. If you are using openstack, you can use the "nose". E.g:
Step four: Disable virtual environment
After completing the work in a virtual environment, simply run the "deactivate" command to exit the isolated environment. Then, you will allow users to use the default shell.
Step Five: Remove the virtual environment