赫罗库没有';t识别Python版本(在本例中为3.6.4,这是必需的)

赫罗库没有';t识别Python版本(在本例中为3.6.4,这是必需的),python,git,heroku,Python,Git,Heroku,我使用git push Heroku master将代码部署到Heroku,但构建失败。以下是输出: Counting objects: 316, done. Delta compression using up to 4 threads. Compressing objects: 100% (305/305), done. Writing objects: 100% (316/316), 12.71 MiB | 915.00 KiB/s, done. Total 316 (delta 83),

我使用git push Heroku master将代码部署到Heroku,但构建失败。以下是输出:

Counting objects: 316, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (305/305), done.
Writing objects: 100% (316/316), 12.71 MiB | 915.00 KiB/s, done.
Total 316 (delta 83), 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.4 (you are using Python 3.6.4, which is unsupported).
remote:  !     We recommend upgrading by specifying the latest version (python-3.6.4).
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing Python 3.6.4
remote:  !     Requested runtime (Python 3.6.4) 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 greensun.
remote: 
To https://git.heroku.com/greensun.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/greensun.git'
正如你所看到的,上面写着:

遥控器:!Python3的最新版本是Python-3.6.4(您使用的是Python3.6.4,这是不受支持的)


如何让Heroku识别Python 3.6.4?(它已经用Ubuntu安装在这台笔记本电脑上,并且应用程序有
runtime.txt
,内容为:
python-3.6.4
)。

刚刚发现,当我在heroku的buildpacks部分的仪表板中将应用程序配置为python时,这个错误不再出现。

是否
runtime.txt
包含其他内容?有空白吗?没有。但是,我在heroku的仪表板中将应用程序配置为python,错误不再出现。我将把这个信息作为答案传递。