Use of Python, Pycharm, virtualenv

Source: Internet
Author: User
Tags virtual environment virtualenv

Create a virtual environment, install multiple libraries at once

Pip Freeze > Requirements.txt (the name of the library is all inside)

Generate Requirements.txt file

Use in another environment

Pip Install-r requirements.txt

PIP3 Install Virtualenv

The first step is to create the directory:

mkdir MyProject

CD myproject/

The second step is to create a separate Python runtime environment named venv:

Virtualenv--no-site-packages venv

Enter the environment:

SOURCE Venv/bin/activate

Installation package:

Cp-f ~/downloads/requirements.txt./

Pip Install-r requirements.txt

Pip Install JINJA2

Exit:

Deactivate

How does virtualenv create a "stand-alone" Python runtime environment? The principle is simple, is to copy the system Python to virtualenv environment, with command source Venv/bin/activate into a virtualenv environment, Virtualenv The relevant environment variables are modified so that both command Python and Pip Point to the current virtualenv environment.

Pycharm Activation Code

Http://idea.liyang.io

Requirements.txt:

backports-abc==0.5
beautifulsoup4==4.5.3 ...

Use of Python, Pycharm, 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.