python 生成requirements 文件

ZapcoMan / 2024-10-10 / 原文

  • python 要生成 requirements文件 有两种情况
  1. 具有独立的虚拟环境
  2. 全局环境

具有独立的虚拟环境

 pip freeze > requirements.txt

全局环境

  • 安装
pip install pipreqs
  • 在当前目录生成
 pipreqs . --encoding=utf8 --force