Python creates a virtual environment (two): Use terminal commands to create a virtual environment

1. Install the third-party package virtualenv for the virtual environment

pip install virtualenv -i https://pypi.douban.com/simple/Insert picture description here

2. Create a virtual environment

(1) Enter the address where you want to store the virtual environment

Insert picture description hereHere I want to put the virtual environment to be created in the D:\ebvs directory

(2) Create a virtual environment

The virtualenv environment name
Insert picture description here
creates a virtual environment named pachong.
Note: Because the third-party package virtualenv was installed under python before, the virtual environment created at this time is based on the python version (3.7.4).

3. Activate the virtual environment

cd d:
cd envs #进入虚拟环境的目录

Activate the environment name to
Insert picture description here
view the third-party libraries installed in the current virtual environment:
Insert picture description here

4. Exit the virtual environment

deactivate
Insert picture description here

5. Delete the virtual environment

Just delete its directory.

Guess you like

Origin blog.csdn.net/qq_45154565/article/details/109351477