SoFunction
Updated on 2024-11-13

Python development virtual environment using virtualenvwrapper build step-by-step tutorial illustrations

virtualenv is a tool for creating isolated Python environments. virtualenv creates a folder containing all the necessary executables to use the packages required for a Python project. The environments created are isolated and do not interfere with each other, and you can use pip for package management without sudo privileges.

The first step installs the package:

Step 2: Create a directory to store the virtual environment

Step 3: Go to the home directory and find.bashrc file and can be seen in the.virtualenvs folder

Step 4: Edit the .bashrc file using vim and add the following at the end of the file

Then save to exit.

Step 5: Run source ~/.bashrc

Step 6: Create a virtual environment for your own use with specific instructions but not too much description: mkvirtualenv -p /usr/bin/python3.5 instagram

Specify the virtual environment python version 3.5.

The virtual environment is automatically entered after successful creation. At this point we check the python version is the default 3.5

Other:

Exit the virtual environment deactivate

View the virtual environment on the current system: workon

Activate or enter a virtual environment: workon instagram

View installed packages in the virtual environment: pit list

View the python path in the virtual environment (aka virtual environment path): which python

summarize

The above is a small introduction to the Python development of virtual environments using virtualenvwrapper build step-by-step tutorial illustration, I hope to help you, if you have any questions please leave me a message, I will reply to you in a timely manner. I would also like to thank you very much for your support of my website!