为基于导入的任何项目生成requirements.txt文件---pipreqs

1.安装 pipreqs

pip install pipreqs

如需查看详细信息:https://github.com/bndr/pipreqs

2.用法:

用法:
    pipreqs [options] <path>

选项:
    --use-local仅使用本地包信息而不是查询PyPI
    --pypi-server <url>使用自定义PyPi服务器
    --proxy <url>使用Proxy,参数将传递给请求库。你也可以设置
                          终端中的环境参数:
                          $ export HTTP_PROXY =“http://10.10.1.10:3128”
                          $ export HTTPS_PROXY =“https://10.10.1.10:1080”
    --debug打印调试信息
    --ignore <dirs> ...忽略额外的目录
    --encoding <charset>使用编码参数打开文件
    --savepath <file>保存给定文件中的需求列表
    --print输出标准输出中的需求列表
    --force覆盖现有的requirements.txt
    --diff <file>将requirements.txt中的模块与项目导入进行比较。
    --clean <file>通过删除未在项目中导入的模块来清理requirements.txt。

$ pipreqs / home / project / location
在/home/project/location/requirements.txt中成功保存了需求文件

猜你喜欢

转载自blog.csdn.net/myli_binbin/article/details/83752270