猿问

为什么 Heroku 找不到满足要求的 'os' 版本?

我正在尝试通过 GitHub 在 Heroku 上部署我的机器人。


在 requirements.txt 中,我有 'os'。我尝试部署机器人,以便 Heroku 能够识别 Procfile。它给了我这个错误。


Collecting os (from -r /tmp/build_e656b8b6627c307b02ef77c47e6bb725/requirements.txt (line 3))

         Could not find a version that satisfies the requirement os (from -r /tmp/build_e656b8b6627c307b02ef77c47e6bb725/requirements.txt (line 3)) (from versions: )

       No matching distribution found for os (from -r /tmp/build_e656b8b6627c307b02ef77c47e6bb725/requirements.txt (line 3))

 !     Push rejected, failed to compile Python app.

 !     Push failed

如何解决?


千万里不及你
浏览 163回答 2
2回答

慕桂英546537

您不需要包含os在您的 requirements.txt 中 - 它是一个内置模块。只需将其删除。

米脂

你不需要 install/require os。它不在包索引上,它是一个内置包。只需os从文件中删除该行requirements.txt即可解决此问题。
随时随地看视频慕课网APP

相关分类

Python
我要回答