【问题标题】:App not compatible with buildpack - Heroku/python应用程序与 buildpack 不兼容 - Heroku/python
【发布时间】:2020-10-03 04:36:56
【问题描述】:

我在尝试将我的项目推送到 GitHub 以连接 Heroku 时收到此消息

-----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz

       More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
       Push failed

我已经将Requirements.txtProcfile 放在了根目录中。我的Requirements.txt 看起来像这样:

json5==0.8.5
jsonschema==2.6.0
regex==2018.2.21
requests==2.23.0
schedule==0.6.0
spotipy==2.12.0
tweepy==3.8.0

而我的Procfile 看起来像这样:

  worker: python app.py

我的 GitHub 仓库是:https://github.com/dahliahadfury/Spotify-recommendation

【问题讨论】:

    标签: python github heroku buildpack


    【解决方案1】:

    我已经将Requirements.txtProcfile 放在了根目录中

    大小写很重要。需求文件必须命名为requirements.txt(全部小写)。

    重命名您的需求文件,再次提交并部署:

    • git mv Requirements.txt requirements.txt
    • git commit -m "Fix name of requirements file"
    • git push heroku master

    【讨论】:

    • 嘿,谢谢您的帮助!我按照你说的做了,但我收到了这条消息:fatal: 'heroku' does not appear to be a git repository fatal: Could not read from remote repository. 这是否意味着 heroku 没有连接到我的 github 存储库?
    • 嘿,非常感谢您的帮助!现在可以了,我用这个解决了上面的问题:stackoverflow.com/questions/18406721/…再次感谢!
    • 是的,或者如果您通过 GitHub 进行部署,您也可以这样做。我认为在这种情况下推送到 GitHub 上的master 应该会自动部署。
    猜你喜欢
    • 1970-01-01
    • 2019-02-05
    • 2018-02-16
    • 1970-01-01
    • 2018-07-07
    • 2018-01-22
    • 2021-11-12
    相关资源
    最近更新 更多