python create a virtual environment to pay attention to the problem in the windows environment

First, python change to the local installation source (if you install third-party libraries fast enough, ignore the first step)
python in the process of creating a virtual environment is to re-install pip and wheel, and the python installation source in the country speed too slow, that they can not use, so you need to change the source.
1, open the path: C: \ Users \ Administrator \ AppData \ Roaming ( specific to its own path based, usually this path, unless you change your username)
2, create a folder PIP
3, into the folder pip: C: \ the Users \ Administrator \ AppData \ Roaming \ PIP
4, create pip.txt in file, file content

[global]
timeout=6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host=pypi.douban.com

5, the file suffix to .ini, namely: pip.ini

Second, the installation creates a virtual environment libraries

pip install virtualenv

Third, create a virtual environment
into your project folder
Here Insert Picture Description

virtualenv  虚拟环境名称(英文)

If there is an exception:

virtualenv  虚拟环境名称(英文) --no-setuptools --no-wheel

Into the environment (virtual environment is activated)
Here Insert Picture Description

cd news
cd Scripts
activate

success

Published 43 original articles · won praise 18 · views 20000 +

Guess you like

Origin blog.csdn.net/human_soul/article/details/104351375