【发布时间】:2020-01-14 09:17:28
【问题描述】:
我正在尝试使用 pipreqs 包来生成 requirements.txt 文件。 Following the documentation's examples 我一直无法让它工作。
看起来很简单,文档告诉我在终端中使用这个命令:
$ pipreqs /home/project/location
就我而言,这是我的项目的位置:
$ pipreqs /Users/ep9k/Desktop/UVA\ Big\Deal
我收到此错误消息:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/ep9k/Desktop/UVA BigDeal/requirements.txt'
错误信息是正确的,该目录中没有 requirements.txt 文件。我正在尝试使用 pipreqs 创建 requirements.txt 文件。
阅读文档,pipreqs 应该扫描 python 文件中的 import 语句并基于此构建 requirements.txt 文档。所以我也尝试了这个,我希望 pipreqs 扫描的文件:
$ pipreqs /Users/ep9k/Desktop/UVA\ Big\Deal/1FigrFunctions.py
我收到了这个错误,和上面的差不多:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/ep9k/Desktop/UVA BigDeal/1FigrFunctions.py/requirements.txt'
我确信解决方案是显而易见的。我做错了什么?
【问题讨论】:
标签: python python-3.x dependencies