美文网首页coding过程中的一些小积累
python 项目如何生成requirements?

python 项目如何生成requirements?

作者: 徐卜灵 | 来源:发表于2018-12-03 16:06 被阅读0次
首先安装 pipreqs 库 :pip install pipreqs

进入需要生成文件的目录执行: pipreqs ./
(或者直接 pipreqs 项目所在目录)

如果出现:UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 776: illegal multibyte sequence这个错误.

解决方法:指定编码格式

pipreqs ./  --encoding=utf8

如果requirements已存在,加入--force参数覆盖重写。

pipreqs ./ --encoding='utf8' --force

pip freeze > requirements.txt 这个把所有包都拉出来了,不推荐。

相关文章

网友评论

    本文标题:python 项目如何生成requirements?

    本文链接:https://www.haomeiwen.com/subject/dufycqtx.html