Skip to main content
 首页 » 编程设计

python之推送失败的 heroku

2025年05月04日23lyhabc

我需要一些帮助来解决这个问题。我在另一个 heroku 帐户中有其他网站,但我没有进入我的空帐户。我正在使用 python3.5.0(但我尝试更改 python 版本但没有成功)和 Django 1.10。我的 git 存储库中有 runtime.txt、procfile.txt,但我遇到了这个问题:(终端)

    Counting objects: 105, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (97/97), done. 
Writing objects: 100% (105/105), 2.22 MiB | 113.00 KiB/s, done. 
Total 105 (delta 34), reused 0 (delta 0) 
remote: Compressing source files... done. 
remote: Building source: 
remote:  
remote: -----> Python app detected 
remote: -----> Installing python-3.5.0 
remote:  !     Requested runtime (python-3.5.0) 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 confiam2. 
remote:  
To https://git.heroku.com/confiam2.git 
 ! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://git.heroku.com/ 

我该如何解决这个问题?我试图更新 heroku 版本,并更改​​ python 版本。没有成功。非常感谢谁能帮助我。

请您参考如下方法:

错误代码是这样的-

Requested runtime (python-3.5.0) is not available for this stack (heroku-16). 

如果您访问 support page建议,您将看到 Python 3.6.2 和 2.7.13 是唯一受支持的运行时。你为什么期望 3.5.0 能工作?更改您的 runtime.txt 文件以包含 python-3.6.2(或尝试其他版本,例如 python-3.5.2,也许它会起作用。谁知道呢,它不受支持)并且该应用程序应该被 Heroku 接受(只要没有其他不相关的问题)。