关于生成requirements.txt文件的方法

1、模块

pip安装pipreqs模块

 

2、 生成文件

法一:常用

在项目目录下

pipreqs /home/project/location    后面跟着的就是项目的绝对路径

 

法二:不常用

项目目录下

pip freeze > requirements.txt

 

3、根据文件一次性安装所有的包

当前项目目录下

pip install -r requirements.txt

 

4、更新文件

pipreqs /home/project/location  --force

posted @ 2018-07-04 18:29  九二零  阅读(144)  评论(0编辑  收藏  举报