Python requirements.txt 生成与使用 来源: Python项目生成requirements_dta0502的博客-CSDN博客_python requirements pipreqs(找当前项目依赖的包) - 就俗人一个 - 博客园 使用 pip 生成 1pip freeze > requirements.txt 这种方式配合 virtualenv 才好使,否则把整个环境中的包都列出来了。 使用 pipreqs 扫描项目文件生成依赖,比 pip freeze 干净。缺点是可能会有些偏差,需要检查并自己调整下。 安装 1pip install pipreqs 运行 1pipreqs ./ --encoding=utf-8 安装项目依赖 1pip install -r requirements.txt