Manage your virtual environment happily: Virtualenvwrapper

Source: Internet
Author: User

Virtualenvwrapper

Virtualenvwrapper provides a series of commands that make working with virtual environments much more enjoyable. It puts all your virtual environments in one place.

Install (make sure the virtualenv is installed):

$ pip Install virtualenvwrapper$ export workon_home=~//usr/local/bin/virtualenvwrapper.sh

For Windows, you can use Virtualenvwrapper-win.

Install (make sure the virtualenv is installed):

$ pip Install Virtualenvwrapper-win

In Windows, the default path for Workon_home is%userprofile%envs.

Basic use
  1. Create a virtual Environment:
     $ mkvirtualenv my_project 

    This will be  ~/envs   Create  my_ Project   folder.

  2. Working on a virtual environment:
    $ Workon My_project

    Alternatively, you can create a project that creates a virtual environment and $WORKON_HOME creates a project directory in. When you use it workon myproject , it is cd -ed to the project directory.

    $ mkproject MyProject

    virtualenvwrapper provides the tab completion function for the environment name. This is useful when you have many environments and it is difficult to remember their names.

    workoncan also stop your current environment, so you can quickly switch between environments. The stop is the same:

  3. The stop is the same:
    $ deactivate

  4. Delete
    $ rmvirtualenv My_project
    Other useful commands
    lsvirtualenv
    List all the environments.
    cdvirtualenv
    Navigate to the directory of the currently active virtual environment, such that you can browse it site-packages .
    cdsitepackages
    Similar to the above, but directly into the site-packages directory.
    lssitepackages
    displays site-packages the contents of the directory.

    A complete list of VIRTUALENVWRAPPER commands.

    Virtualenv-burrito

    With Virtualenv-burrito, you can use a single-line command to have virtualenv + virtualenvwrapper environment.

    Autoenv

    When you cd enter a contained .env directory, the environment is automatically activated by autoenv.

    Use brew to install it on Mac OS x:

    $ Brew Install Autoenv

    On Linux:

    $ git clone git://github.com/kennethreitz/autoenv.git ~/.autoenv'source ~/.autoenv/ activate.sh' >> ~/.BASHRC

Manage your virtual environment happily: Virtualenvwrapper

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.