Ubuntu Installation and Configuration Virtualenv,virtualenvwrapper

Source: Internet
Author: User

Installing Virtualenv

Install virtualenv

If the download is slow, you can add a watercress source:

Install -I https:///pypi.douban.com/simple/virtualenv

It is also possible to download other packages using a watercress source.

To create a virtual environment using virtualenv:

Virtualenv  -p/pah/to/your/python/Environment name

Operating Environment:

Source Activate Environment name

To exit the environment simply enter the following code in the environment:

Deactivate

Manage virtual environments with Mkvirtualenv:

Install Virtualenvwrapper

Configuring the Workon Path

Add the following code in ~/.BASHRC:

Export Workon_home = $HOME//your/path/to/virtualenvwrapper. SH

You can find the virtualenvwrapper.sh path by using the following code:

sudo Find /-name virtualenvwrapper. SH

Use the following code to make the Workon configuration effective:

SOURCE ~/.BASHRC

Then start the environment simply by following the code:

Workon Environment Name

See all built environments:

Workon

Create a virtual Environment from MKVIRTUALENV:

Mkvirtualenv--python =/your/python/pah/Environment name

Or

MKVIRTUALENV-P/your/path/to/python Environment Name

Recommend a Python environment management tool pyenv, with this tool to control the Python version, but also simplifies the configuration of the virtual environment, pyenv installation configuration can refer to my essay

An example of using virtualenvwrapper after configuring a python version with pyenv:

MKVIRTUALENV Environment Name

is not a lot of simple, I hope this article is helpful to you, thank you.

Ubuntu Installation and Configuration Virtualenv,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.