当前位置:网站首页>使用pipreqs导出项目所需的requirements.txt(而非整个环境)
使用pipreqs导出项目所需的requirements.txt(而非整个环境)
2022-08-03 07:30:00 【木尧大兄弟】
之前一直用pip freeze > requirements.txt导出requirements.txt,优点是不用安装其他依赖,缺点是会将项目依赖的python环境中所有依赖都输出。
替代方案: 使用pipreqs导出。
pip install pipreqs
pipreqs . --encoding=utf8 --force
安装并执行,如上所示,就会将requirements.tx输出到执行命令所在的目录。
如此清爽。再也不用担心安装一些乱七八糟的包了。
附上Dockerfile安装脚本:
RUN python -m pip install -r /xxxxx/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
边栏推荐
猜你喜欢
随机推荐
JS函数获取本月的第一天和最后一天
Roson的Qt之旅#103 QML之标签导航控件TabBar
华为设备配置BFD多跳检测
差分(前缀和的逆运算)
pyspark---encode the suuid interval (based on the number of exposures and clicks)
Nanny level explains Transformer
加速FinOps实践,为企业降本增效
【图像去雾】基于matlab暗通道和非均值滤波图像去雾【含Matlab源码 2011期】
数据库表结构文档 生成工具screw的使用
Postman will return to the interface to generate a json file to the local
tolower函数
Shell脚本之一键安装mysql
一文搞懂什么是@Component和@Bean注解以及如何使用
consul理解
boot - SSE
工控机防勒索病毒浅析
ArcEngine(五)用ICommand接口实现放大缩小
STL迭代器
Poke the myth of Web3?Poke the iron plate.
推荐系统-排序层-精排模型:LR、GBDT、Wide&Deep、DCN、DIN、DIEN、MMOE、PLE









