virtualenv generated virtual environment, pip freeze export-dependent, with domestic sources to accelerate the installation of the export-dependent requirements.txt

1. Create a virtual environment and run

virtualenv blog-env # 会在工作目录生成一个blog-env的文件夹版本为当前默认python
##或 如果要生成一个非默认版本可运行下一句
virtualenv -p C:\Python\python27\python.exe blog-env

cd blog-env #进入
cd scripts 

activate.bat #运行虚拟环境

2. Export installation environment

pip freeze > requirements.txt

3. Install the exported domestic source environment (requirements.txt first cd into the directory)

pip install -i https://pypi.doubanio.com/simple/ -r requirements.txt

Guess you like

Origin www.cnblogs.com/chenxi188/p/12564517.html