【发布时间】:2018-03-19 07:00:09
【问题描述】:
我一直在处理一个我试图部署到 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。
【问题讨论】: