Virtualenv the windows using multiple versions of python isolated development

Installation under virtualenv 1.windows

 
 
pip install virtualenv

2. Go to the project directory, create a virtual environment, such as:

virtualenv venv (default python version) 
virtualenv -pc: \ Python37 \ python.exe HigEnv (version python37) 
virtualenv -pc: \ Python27 \ python.exe LowEnv (version python27) 
virtualenv --no- Site -packages - Python 3.7 = HigEnv
 

Description: -p is the python version (need to take the path) HigEnv is the virtual environment variables. -no-site-packages is now the default option, so that the isolation environment can not access the system global site-packages directory.

3. Enable the environment, the implementation activate

image

4. Install third-party libraries

Now you can install from the command pip install python wrapped in venv environment, use pip install package will no longer be overall package will only play a role in the current virtual environment to avoid contamination of the system environment.

5. Exit the environment

pip install virtualenv

VsCode Development

After a while vscode development project, open the project directory, if useless activated, the activation command will be executed every time debugging, if the console is activated, you do not need to activate when debugging. This pretty smart.

image

The figure above shows a virtual environment

image

The figure above shows: If not activated, activate debugging. If you activate the console, direct debugging.

Currently it is recommended to perform activation in console, vscode terminal no effect

image

Guess you like

Origin www.cnblogs.com/WoodFish/p/11512625.html