【发布时间】:2022-01-25 15:31:07
【问题描述】:
Heroku 不会为我的 Django 应用推送我的 Python 版本,我不知道为什么...我将我的 python 从 3.8.7 升级到 3.10.2 并将其反映在 runtime.txt 文件中,以及更改已明确添加,但这似乎不起作用。
来自 heroku 的 Python 支持:
Supported runtimes
python-3.10.2 on all supported stacks
C:\Users\New User\Downloads\django-modal-ajax-crud-main\django-modal-ajax-crud-main>git push heroku main
Enumerating objects: 191, done.
Counting objects: 100% (191/191), done.
Delta compression using up to 4 threads
Compressing objects: 100% (173/173), done.
Writing objects: 100% (191/191), 72.21 MiB | 1.24 MiB/s, done.
Total 191 (delta 35), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Python app detected
remote: -----> Using Python version specified in runtime.txt
remote: ! Requested runtime ("python-3.10.2") is not available for this stack (heroku-20).
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 whispering-oasis-59527.
remote:
To https://git.heroku.com/whispering-oasis-59527.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/whispering-oasis-59527.git'
【问题讨论】:
-
我会开一张 Heroku 支持票。这似乎是一个错误。
-
你的
runtime.txtUTF-8 编码了吗? -
不管它是如何编码的,heroku 正在接收正确的请求,因为它在错误中字面意思是
Requested runtime ("python-3.10.2")。旁注:标签git 在这里不适用。您正在使用 Git 存储您的存储库并要求 Heroku 构建,但 Git 并没有参与产生您在此处看到的任何错误:它只是在传递东西 来自 Heroku。 -
@RCarmody,另外,该文件使用什么行尾?
-
我有类似的东西,我不得不使用以下命令对其进行更多调试。这不是一个答案,但也许它可以帮助你更接近?注意:由于我的收集静态阶段,我遇到了这个错误。 heroku 配置:设置 DEBUG_COLLECTSTATIC=1