使用$ git push heroku master时出错,即使runtime.txt是正确的

时间:2018-06-12 19:59:37

标签: python git heroku python-3.6 heroku-cli

我正在尝试使用$ git push heroku master但是我收到了这个错误:

$ git push heroku master
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 534 bytes | 534.00 KiB/s, done.
Total 6 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote:  !     The latest version of Python 3 is python-3.6.5 (you are using , which is unsupported).
remote:  !     We recommend upgrading by specifying the latest version (python-3.6.5).
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing
remote:  !     Requested runtime () is not available for this stack (heroku-16).
remote:  !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to securibot.
remote:
To https://git.heroku.com/securibot.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/securibot.git'

我的runtime.txt文件读取以下内容:

python-3.6.5

知道我为什么会收到此错误?

1 个答案:

答案 0 :(得分:0)

您是否阅读过发布的引用网址?

如果查看https://devcenter.heroku.com/articles/python-runtimes,您会看到“新创建的Python应用程序默认为Python 3.6.4运行时”。

您可以在Pipfile中指定自己的运行时,也可以使用以下命令创建runtime.txt:

python-3.6.5