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
Python2C:\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