【问题标题】:ERROR: Could not find a version that satisfies the requirement get in requirement.text错误:在require.text中找不到满足要求的版本
【发布时间】:2021-03-31 11:08:09
【问题描述】:

我尝试在 cmd 中运行git push heroku master,但出现以下错误:

 ERROR: Could not find a version that satisfies the requirement get (from -r /tmp/build_8801ce40/requirements.txt (line 2)) (from versions: none)       

ERROR: No matching distribution found for get (from -r /tmp/build_8801ce40/requirements.txt (line 2))
remote:  !     Push rejected, failed to compile Python app.

我已在我的requirements.txt 中列出如下:

Flask==0.11.1
get
gunicorn==19.6.0
post
requests
wikipedia
line-bot-sdk
pandas==0.20.3
googletrans

问题是什么,我该如何解决?

【问题讨论】:

  • 你想做什么?
  • 谢谢大家,已经修复,我只需要删除get & post :((

标签: python heroku


【解决方案1】:

您的requirements.txt 应该只包含您需要安装的模块。 getpost 几乎肯定不属于这里。

如果你正在做类似的事情

from requests import get

您的文件中需要requests。但是您不需要需要get——它带有requests。这就是from requests 部分的含义。

尝试将您的requirements.txt 编辑成类似这样的内容:

Flask==0.11.1
gunicorn==19.6.0
requests
wikipedia
line-bot-sdk
pandas==0.20.3
googletrans

然后提交并重新部署。

确保您的requirements.txt 包含在开发中使用它的好方法。将新的依赖项直接添加到该文件,然后添加pip install -r requirements.txt。在这种情况下,您会更早发现问题。

【讨论】:

    猜你喜欢
    • 2021-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-04
    • 1970-01-01
    • 2021-04-25
    • 1970-01-01
    • 2023-03-20
    相关资源
    最近更新 更多