Ubuntu 下生成 python 环境安装文件 requirements.txt

参考:

Ubuntu 下生成 python 环境安装文件 requirements.txt

首先通过 pip 安装pyreqs模块:

pip install pipreqs

然后进入 python 源码所在的目录下,执行:

pipreqs ./

该命令在当前目录下生成 requirements.txt

如果需要在一个新的环境下重新安装源码需要的依赖包,只需执行:

pip install -r requirements.txt

2018.9

原文地址:https://www.cnblogs.com/qq952693358/p/9610217.html