【问题标题】:Heroku Deployment Issue - Python versionHeroku 部署问题 - Python 版本
【发布时间】: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。

【问题讨论】:

    标签: python django git heroku


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-28
      • 2022-11-08
      • 2017-02-08
      • 2015-06-05
      • 1970-01-01
      • 1970-01-01
      • 2016-05-11
      相关资源
      最近更新 更多