1. Why Python virtual environment
In actual work, the python versions we contact are often different from the relevant web framework versions. For example, some combinations may be python2 + django1.8, and some may be python3.6 + django1.12. It’s easy to do both. Wouldn’t it be good for me to install two versions of Python on my computer?
But what if there are 5678 projects that require 5678 sets of Python environment? This is the virtual environment.
Download the installation package directly. After downloading, just go to the next step and install it by default.
2.2 Linux or Mac
Download the script xxxx.sh directly. XXXX refers to the version number. Open the console terminal, CD to the download directory, and then install sh xxxx.sh directly. Therefore, it is necessary for students who want to learn to listen to the teacher’s class and receive Python fulio. Students who want to learn can go to Wai Xin of Mengya teacher (homonym): the front group is mengy and the back group is 7762. Just combine the above two groups of letters in order, and she will arrange learning.
3 how to play – Basic Commands
3.1 basic command description
(windows is best used with conemu)
Relevant documents are here:
[8 groups of programmers’ cooking time] tool link:https://pan.baidu.com/s/1i5HtBFnPassword: kw4f
New virtual environment diagram:
3.2 write a Django environment test:
Open the browser and you can see the working interface at 127.0.0.1:8000.
4 custom command alias [this is the key]
Are some of the above commands not working? Don’t worry, because I customized some.
The following is made up by myself. You can customize it. Then put it in. Bashrc, or. Bash_ Profile is OK!
4.1 Linux or Mac
Note: for Linux, you’d better add environment variables yourself. You’ll be reminded when CONDA’s script is executed.
Add the following line to. Bashrc,
Finally, don’t forget to reload.
4.2 windows is best used with conemu
In settings – > startup > environment
alias cl=conda env list
alias cc=conda create -n $*
alias coa=activate $*
alias cr=conda remove –all -n $*
Usage example of “supplement” in MAC
The whole process of establishing py3-dj, using and deleting