For more Python development content, visit: "Python Flask Development Guide"
virtualenv
It can help us create a Python
virtual environment. The virtual environment can be independent and isolate the external python
environment, so that we can use different python
dependencies for different projects, and errors caused by different versions of dependencies. This article is mainly to understand how to use the isolation of the virtualenv
environment python
.
install virtualenv
We can pip
install it through virtualenv
, the installation code is as follows:
$ pip install virtualenv
Create a virtual environment
After installation virtualenv
, we can virtualenv
create a virtual environment through the project.
$ virtualenv venv
Create a command in the root directory of the project venv
, which will store all dependent python
libraries in the project.