首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Heroku Python部署版本问题

Heroku Python部署版本问题
EN

Stack Overflow用户
提问于 2022-01-25 15:31:07
回答 1查看 673关注 0票数 1

Heroku不会把我的Python版本推给Django应用程序,我也不知道为什么.我将python从3.8.7升级到3.10.2,并在runtime.txt文件中反映了这一点,这些更改显然是添加的,但这似乎不起作用。

来自heroku的Python支持:

代码语言:javascript
复制
Supported runtimes
python-3.10.2 on all supported stacks
代码语言:javascript
复制
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'
EN

回答 1

Stack Overflow用户

发布于 2022-02-01 02:27:23

我现在真的用3.10.2部署了,所以它是可用的

因此,您的问题似乎有一个错误,这是解释在您的输出结束。

代码语言:javascript
复制
Requested runtime ("python-3.10.2") is not available for this stack (heroku-20).
...
.. (pre-receive hook declined)

码头文件说:

runtime.txt格式区分大小写,不能包含空格.还必须在runtime.txt中指定所有三个版本号组件(主要、次要和修补程序)。 如果您不遵循这种格式,您的应用程序将无法部署。

因此,确保没有空白或新行,并始终跟踪支持运行时

另外

你可以去掉runtime.txt

app.json应该在关键字中有带有、无版本python"image": "heroku/python"

然后用默认版本立即安装3.9.10

然后您可以使用runtime.txt进行更新

首先:确保应用程序在本地机器上正常运行。

这也可能是类似于此对这个答案的第一个评论的依赖错误。

在部署时,应用程序和构建依赖项应该是功能性的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70851372

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档