Can you use Python virtual environment? Teach you hand in hand

Time:2021-7-30

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.

Can you use Python virtual environment? Teach you hand in hand

2.1 Windows

Download the installation package directly. After downloading, just go to the next step and install it by default.

Can you use Python virtual environment? Teach you hand in hand

Can you use Python virtual environment? Teach you hand in hand

Can you use Python virtual environment? Teach you hand in hand

Can you use Python virtual environment? Teach you hand in hand

Can you use Python virtual environment? Teach you hand in hand

Can you use Python virtual environment? Teach you hand in hand

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

Can you use Python virtual environment? Teach you hand in hand

Can you use Python virtual environment? Teach you hand in hand

Can you use Python virtual environment? Teach you hand in hand

New virtual environment diagram:

Can you use Python virtual environment? Teach you hand in hand

Can you use Python virtual environment? Teach you hand in hand

Can you use Python virtual environment? Teach you hand in hand

3.2 write a Django environment test:

Can you use Python virtual environment? Teach you hand in hand

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

Can you use Python virtual environment? Teach you hand in hand

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,

export PATH=/root/anaconda3/bin:$PATH

Finally, don’t forget to reload.

source ~/.bashrc

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 cod=deactivate

alias cr=conda remove –all -n $*

Usage example of “supplement” in MAC

The whole process of establishing py3-dj, using and deleting

Can you use Python virtual environment? Teach you hand in hand

Can you use Python virtual environment? Teach you hand in hand

Can you use Python virtual environment? Teach you hand in hand

Recommended Today

Implementation example of go operation etcd

etcdIt is an open-source, distributed key value pair data storage system, which provides shared configuration, service registration and discovery. This paper mainly introduces the installation and use of etcd. Etcdetcd introduction etcdIt is an open source and highly available distributed key value storage system developed with go language, which can be used to configure sharing […]