virtualenv------用来建立一个虚拟的python环境,一个专属于项目的python环境。用virtualenv 来保持一个干净的环境非常有用
1、通过pip安装virtualenv:
pip install virtualenv
2、测试安装
virtualenv --version
3、为一个工程项目搭建一个虚拟环境:
cd my_project
virtualenv my_project_env
4、运行如下命令,即可在项目中可见自动生成了requirements.txt的文件
pip freeze > requirements.txt
二、自动导入requirements.txt中的库
pip install -r requirements.txt