tags: virtualenv and virtualenvwrapper virtualenv virtualenvwrapper
Operating System: wins7
python Version: 3.7.0
python3.7.0 version comes pip, in order to reduce the installation step, using pip installation;
cmd, open the windows command line;
pip install virtualenv
pip install virtualenvwrapper # This is virtualenv package version must be installed after the virtualenv
cd E: python3 # access to the file
virtualenv envname # create a name for the virtual environment envname
dir # View the current directory can know that a file has been created envname
virtualenv -p python2 envname # If you have multiple versions of python installed, such as py2 and py3, you need to specify which create virtual environments
note:If you do not recognize virtualenv command, may be added to the python installation path did not install the system environment variables or virtualenv or not to re-open a cmd window
# File into the virtual environment
cd envname
# To enter the relevant startup folder
cd Scripts
activate # start the virtual environment
deactivate # exit virtual environment
Or:. \ Env \ Scripts \ activate.bat
View package python virtual environment installationpip install package
easy_install package[.exe|.egg]
The following are free to install a variety of packages in a virtual environment.
pip install virtualenvwrapper-win
can set the environment variable WORKON_HOME default path specified virtual environment virtualenvwrapper
Create a virtual environmentmkvirtualenv env
View all virtual environment and start a virtual environmentlsvirtualenv
workon
workon env
Exit Virtual Environmentdeactivate
Adds the specified path to virtualenv_path_extensions.pth under sitepackages catalog can import directly, when the virtual environment is added to the virtual environment, not the boot environment to the default pythonadd2virtualenv path
Issues and details
Under Scripy directory files every time you need to start the virtual environment when they are required to enter the virtual environment of the clip, very inconvenient, you can add Scripy path to the system environment variable.
If want to install other versions of the python, such as python2.7.13; after adding it to the system path environment variable, enter the installation file directory, the file will be changed python2.exe python.exe file to prevent conflicting commands;
If there are multiple versions of python at the same time, then there are several versions pip, pip install using this time to specify python version.
python -m pip install xxx # python3 version installation package
python2 -m pip install xxx # python2 version installation package
installation Create a virtual environment Choose to use a Python interpreter to add the -p parameter Activate virtual environment Under linux Win environment enters Jump out of the currently active en...
Introduction Make the Python library in your system very clean. In systems such as MAC or Linux, the system itself uses Python, and many python libraries are installed during development, which makes ...
Virtualenv -- python virtual sandbox Some people say that virtualenv, fabric and pip are the three great artifacts of pythoneer. First, the installation Second, create a virtual environment Third, sta...
Virtual Environment Introduce the principle of virtual environment: Virtual environment is equivalent to a drawer, any packages installed in this drawer will not affect other drawers. And in the proje...
virtualenv is a tool to create an isolated Python environment. virtualenv creates a folder containing all the necessary executable files to use the packages required by the Python project. install ...
Environmental information Operating system: windows10 Python version: 3.6.3 installation Download and install python3.6.3 Enter the official website:https://www.python.org/downloads(windows) Choice: W...
Python virtual environment installation, taking Windows as an example virtualenv Virtualenv advantage Separate different application development environments The environment upgrade does not affect ot...
virtualenv The system will lead to more python mix$PYTHONPATHConfusion, or various engineering requirements for different versions of the package so the situation. There is a simple solution is to use...