python - Heroku 无法识别 Python 版本(这是必需的版本,在本例中为 3.6.4)
问题描述
我正在使用 将我的代码部署到 Heroku git push heroku master
,但构建失败。这是输出:
Counting objects: 316, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (305/305), done.
Writing objects: 100% (316/316), 12.71 MiB | 915.00 KiB/s, done.
Total 316 (delta 83), 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.4 (you are using Python 3.6.4, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.4).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing Python 3.6.4
remote: ! Requested runtime (Python 3.6.4) 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 greensun.
remote:
To https://git.heroku.com/greensun.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/greensun.git'
如您所见,它说:
偏僻的: !Python 3 的最新版本是 python-3.6.4(您使用的是 Python 3.6.4,它不受支持)。
如何让 Heroku 识别 Python 3.6.4?(它已经安装在这台带有 Ubuntu 的笔记本电脑上,并且该应用程序具有runtime.txt
内容:)python-3.6.4
。
解决方案
刚刚发现此错误停止出现,因为我在 buildpacks 部分的 heroku 仪表板中将应用程序配置为 Python。
推荐阅读
- web-services - S/4HANA ABAP 中的消费者 WebService
- relayjs - 中继实现给出 401 作为响应
- android - 如何在 Android 中保持 3DES 密钥的安全
- html - 在父 jQuery 对话框 div 的宽度之外显示子 div
- mongodb - 如何参考 MongoDB 模型找到
- git - 我可以在没有 rerere 历史数据库的情况下强制执行“无更改变基”吗?
- ios - 如何将数据从单元格传递到另一个 ViewController
- ios - Xcode 13 - '/Users/test.xcodeproj' 中的项目无法打开,因为它是未来的 Xcode 项目文件格式
- linux - 已解决:为什么我可以使用我的 .pgpass 凭据登录到我的数据库,但不能使用 pg_dump?
- dart - 本身是通用的通用参数