Creating an isolated Python runtime environment with VIRTUALENV

Source: Internet
Author: User
Tags virtual environment virtualenv

In the Ubuntu 14.04 system, for example, the Python and Python3 installed are 2.7.6 and 3.4.3, but some projects require a specific Python version. The current system default Python is already closely coupled with the system, you can not arbitrarily uninstall or upgrade the default Python, otherwise it may cause the system is not available. In this case, you can use Virtualenv to create a Python isolated environment that resolves multiple versions of conflicts between different applications. The specific installation and use steps are as follows,

Install Virtualenv,

sudo Install virtualenv

Create a clean Python runtime environment, named PvE, the parameter--no-site-package means not to copy the installed third-party package to the newly created Python environment, run completion will generate folder PvE in the current directory,

$ virtualenv--no-site-packages PvE

As the next command enters the new Python virtual environment, in the virtual environment, you can install a variety of required third-party packages, without affecting the host's Python environment,

$ source Pve/bin/activate

To exit the Python virtual environment, the command is as follows,

Finish.

Creating an isolated Python runtime environment with VIRTUALENV

Related Article

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.