我是 Heroku 的新手,当我尝试将我的项目推送到 Github 时,我只是收到错误消息:
应用与 buildpack 不兼容:https://github.com/heroku/heroku-buildpack-python.git
完整输出:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: https://github.com/heroku/heroku-buildpack-python.git
remote: -----> App not compatible with buildpack: https://github.com/heroku/heroku-buildpack-python.git
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected
remote:
To https://git.heroku.com/appname.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/appname.git'
我的根目录中有一个 Procfile:
web: gunicorn Food_Blog.wsgi --log-file -
我还有一个 requirements.txt 和 runtime.txt 文件
运行时.txt:
python-3.8.1
有人知道如何解决这个问题吗?
答案 0 :(得分:1)
Heroku 未将您的应用程序检测为 Python。您的 requirements.txt 文件可能有问题。您应该更正文件并检查是否有任何类型的输入错误。 您可以使用以下方法创建一个:
pip freeze > requirements.txt
您也可以尝试使用 heroku python buildpacks 支持的这些 python 运行时之一。
python-3.9.4
python-3.8.9
python-3.7.10
python-3.6.13
python-2.7.18