Nothing Special   »   [go: up one dir, main page]

windows under the python virtual environment virtualenv and virtualenvwrapper Installation and Use

tags: virtualenv and virtualenvwrapper  virtualenv  virtualenvwrapper

Environmental Information

  • Operating System: wins7

  • python Version: 3.7.0

installation

  1. Download and install python3.7.0 slightly [...]
  2. Installation virtualenv
  • 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 
  • After the installation is complete, enter pip list, view the current all installed packages;

Create a virtual environment

  • Select a virtual environment used to store files, such as E: / python3
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

Start the virtual environment

# 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 installation
pip install package

easy_install package[.exe|.egg]

The following are free to install a variety of packages in a virtual environment.

virtualenvwrapper installation


   pip install virtualenvwrapper-win
can set the environment variable WORKON_HOME default path specified virtual environment virtualenvwrapper

  1. Create a virtual environment
    mkvirtualenv env

  2. View all virtual environment and start a virtual environment
    lsvirtualenv
    workon
    workon env

  3. Exit Virtual Environment
    deactivate

  4. 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 python
    add2virtualenv 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
  • After each addition of system environment variables, you need to close the current cmd window, restart a window to take effect.

Intelligent Recommendation

Python virtual environment --virtualenv, virtualenvwrapper

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...

Python virtual environment virtualenv+ virtualenvwrapper

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 ...

Python virtual environment -- virtualenv , virtualenvwrapper

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...

python virtual environment Virtualenv and Virtualenvwrapper

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...

python virtual environment virtualenv/virtualenvwrapper

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 ...

More Recommendation

Windows python virtual environment virtualenv installation and use

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 virtualenv, virtualenvwrapper - install virtual environment in Windows environment

Python virtual environment installation, taking Windows as an example virtualenv Virtualenv advantage Separate different application development environments The environment upgrade does not affect ot...

Windows Python virtual environment virtualenv, virtualenvwrapper (specified version)

table of Contents   Introduction: First, virtualenv 1, install virtualenv 2, create a virtual environment Create directly Specified version creation 3, open, exit the virtual environment 4, delet...

Centos7 virtual environment virtualenv and virtualenvwrapper installation and basic use

One.Reasons for using virtual environments currently using Python In the development process, if there are many projects, it is inevitable that different projects rely on different versions of librari...

Use virtual environment virtualenv / Virtualenvwrapper isolate multiple python

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...

Copyright  DMCA © 2018-2025 - All Rights Reserved - www.programmersought.com  User Notice

Top