Python之生成项目依赖包文件requirements.txt

 

 

首先输入

pip3 install pipreqs

执行这个就会 生成requirements.txt

pipreqs ./

在Windowns里如果遇到这样的报错

UnicodeDecodeError: 'gbk'codec can 't decode byte 0xae in position 286: illegal multibyte sequence

就去python的库里面找到pipreqs.py大概一百一二十行里找到这个

with open(file_name, "r", encoding=encoding) as f:  

把encoding改成      ‘utf-8’      Tips:这个单引号也是 

就完美解决了

posted @ 2021-12-04 14:11  橙橙橙Cc  阅读(39)  评论(0编辑  收藏  举报