Linux configuration and use of virtual environments virtualenv

Source: Internet
Author: User

1. Installation

sudo apt-get install python-virtualenv

2. Use

To create a virtual environment:

virtualenv [Virtual Environment name]

Example: Virtualenv python27

To activate using a virtual environment:

SOURCE ~/workplace/python27/bin/activate

Installation Library:

Example: Pip Install NumPy

Some libraries such as TensorFlow may have an error when installing: Could not find any downloads that satisfy the requirement TensorFlow, which is generally due to the PIP version being too low, Look at the PIP version number:

Pip--version

Then update the PIP:

Pip Install-u pip

Then re-pip to install the TensorFlow on it.

Use the following command to see which packages are installed in your current environment:

Pip Freeze

Exit the virtual Environment:

Deactivate

To delete a virtual environment:

rmvirtualenv [Virtual Environment name]

Linux configuration and use of virtual environments virtualenv

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.