Python Virtual Environment

Source: Internet
Author: User
Tags virtual environment

1. Why use a Python virtual environment

The actual work, we touch the Python version and the relevant version of the Web framework is often different, such as some combinations may be python2 + Django1.8, some may be python3.6 + Django1.12, two is OK, I installed two versions of P on the computer Ython not good?
However, if you have 5678 projects, you need 5678 sets of Python environments? This is the turn of the virtual environment.

2. Download and install

Virtual Image:
Download the image of Tsinghua [https://mirror.tuna.tsinghua.edu.cn/help/anaconda/]
Tool (instead of cmd in window):
Windows Mate Conemu uses
Baidu Direct Search Conemu Download installation files
or Baidu Cloud Disk Link: https://pan.baidu.com/s/1i5HtBFn Password: kw4f

3 How to play-basic command

Custom commands:
1. View version
Alias cl= "Conda env list"
2. Install a virtual environment (one version)
Alias cc= "Conda create-n"
3. Activating a virtual environment (enter a version)
Alias coa= "source Activate"
4. Do not activate a virtual environment (exit a version)
Alias cod= "Source Deactivate"
5. Removing a virtual Environment (uninstall)
Alias cr= "Conda Remove--all-n"
————————————————
Click the setting option to set the alias:
Alias Cl=conda env List
Alias Cc=conda Create-n $
Alias Coa=activate $

Alias Cod=deactivate
Alias Cr=conda Remove--all-n $
————————————————
Install Python2, named Python2
\>CC Python2 python=2 Django
\>cl
#conda environments:
Base C:\Users\home\Miniconda3
Python2
C:\Users\home\Miniconda3\envs\python2
\> CoA python2
\> Pip Freeze
certifi==2018.4.16
django==1.11.10
pytz==2018.4
wincertstore==0.2
\> cod
Install the PYTHON3 virtual environment with the name Python3
\>CC Python2 python=2 Django
\>cl
#conda environments:
Base C:\Users\home\Miniconda3
Python2 C:\Users\home\Miniconda3\envs\python2
Python3 *c:\users\home\miniconda3\envs\python3
\> CoA python2
\> Pip Freeze
certifi==2018.4.16
django==2.0.2
pytz==2018.4
wincertstore==0.2
\> cod

Python Virtual Environment

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.