Heroku部署问题 - Python版本

时间:2017-10-07 17:41:12

标签: python django git heroku

我一直在研究我正在尝试部署到Heroku的Django项目。我已经按照Python Crash Course的教程进行了操作。当我输入git push heroku master时,我得到以下内容作为回复:

Counting objects: 73, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (65/65), done.
Writing objects: 100% (73/73), 26.20 KiB | 0 bytes/s, done.
Total 73 (delta 8), 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.2 (you are using Python-2.7.12, which is unsupported).
remote:  !     We recommend upgrading by specifying the latest version (python-3.6.2).
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing Python-2.7.12
remote:  !     Requested runtime (Python-2.7.12) 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 fathomless-scrubland-11916.
remote: 

当我使用Python --version时,cmd行返回2.7.14,这是最新版本。我觉得这个错误告诉我我需要使用Python3,但他们的网站也说支持2.7.14。我的runtime.txt指定2.7.14。

1 个答案:

答案 0 :(得分:0)

请在runtime.txt中尝试python-3.5.2 虽然它发出警告但它仍然有效