Configuring python virtual environment: virtualenv and virtualenvwrapper-win usage

Version: python37, virtualenv == 16.7.8, virtualenvwrapper-win == 1.2.5

pip37 install virtualenv installation support virtual environment package, pay attention to here is the pip python37 be installed 
after completion, can be seen virtualenv.bat file scripts python37 inside
pip37 install virtualenvwrapper-win virtualenv inconvenient to use only manage a virtual environment, virtualenvwrapper can manage multiple virtual environments
is complete, you can see mkvirtualenv.bat and workon.bat of scripts and other documents in python37 inside
virtualenv myenv virtualenv installation with a single virtual environment, the default is installed in: C: \ Users \ Administrator \ myenv \ Scripts \ python.exe
C: \ the Users \ Administrator \ myenv \ Scripts> to enter the virtual environment of an activate
(myenv) C: \ Users \ Administrator \ myenv \ Scripts> python try python can not be used
(myenv) C: \ Users \ Administrator \ myenv \ Scripts> pip3 install requests to check pip installation package is not in the virtual environment inside
(myenv) C: \ Users \ Administrator \ myenv \ Scripts> deactivate exit the virtual environment
mkvirtualenv myenv01 install virtual environment myenv01 with virtualenvwrapper (wrapper installed all the default virtual environment will be placed in C: \ Users \ Administrator under \ Envs)
After installation will automatically enter the virtual environment
(myenv01) C: \ Users \ Administrator> try python python can not be used
(myenv01) C: \ Users \ Administrator> pip3 install requests to check pip installation package is not in the virtual environment inside
(myenv01) C: \ Users \ Administrator> pip36 only one place on my computer there pip36, and enter pip36 here and there is no error, it explained in a virtual environment, giving priority to find their own scripts, the system can not find the path to go inside to find
(myenv01) C: \ Users \ Administrator> deactivate exit the current virtual environment
mkvirtualenv myenv02 -p C: \ Python36 \ python36.exe can specify the virtual environment python version
(myenv02) C: \ Users \ Administrator> python >>> Python 3.6.8 it it it it it it visible Python 3.6.8 is successful used in this virtual environment
workon see what are the current virtual environment
due virtualenvwrapper put these commands are on the scripts python37's, And I took that path is added to the system environment variables, all can be used directly
workon myenv01 directly into the virtual environment

Guess you like

Origin www.cnblogs.com/jiangzongyou/p/11962804.html