python-3.x - Heroku push:“Git push Heroku master”和“Buildpack”失败-> Python
问题描述
我真的搞砸了这个问题......我已经在寻找合适的解决方案,但到目前为止没有任何效果。所以,我希望有人能给我一个提示!
我已经手动将 Buildpack 设置为 python!但他不会接受.../python.gtz。谢谢!
(venv) jpt@MacBookProJT95 SMA % git push heroku master:main
Enumerating objects: 16, done.
Counting objects: 100% (16/16), done.
Delta compression using up to 4 threads
Compressing objects: 100% (13/13), done.
Writing objects: 100% (16/16), 2.95 KiB | 1.47 MiB/s, done.
Total 16 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: dc06a64ffe6a009a19697612b27abbb653ef757d
remote: !
remote: ! We have detected that you have triggered a build from source code with version dc06a64ffe6a009a19697612b27abbb653ef757d
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to first-murmeltier.
remote:
To https://git.heroku.com/first-murmeltier.git
! [remote rejected] master -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/first-murmeltier.git'
解决方案
我将所需的 python 版本定义为“Python 3.6.x”——但它必须是“Python-3.6.x”(破折号是关键!)
这就是“指定 Python 运行时”在指定 Python 版本中确实记录的内容:
默认情况下,新创建的 Python 应用程序使用 python-3.9.6 运行时。
您还可以指定不同的受支持的 Python 版本。支持的运行时
- 所有支持的堆栈上的 python-3.9.6
- 所有支持的堆栈上的 python-3.8.11
- 所有支持的堆栈上的 python-3.7.11
- 所有支持的堆栈上的 python-3.6.14
并且,如此处所示,确保runtime.txt
正确编码。
推荐阅读
- python - 带有身份验证访问令牌的 python 请求
- c# - 将 UINT64 编码为浮点数
- java - 你能给我这个由我制作的新选择排序算法的时间近似值吗(如 n^2 , n*2 , nlogn )
- javascript - Angular - 在本地文本文件中保存 blob?
- operating-system - 无需驱动程序直接寻址外部硬件?
- windows - 我应该编写什么类型的驱动程序来模拟鼠标输入,就好像它是由真实设备发出的一样?
- php - 大于 5MB 的附件的 GMail API“请求实体太大错误 413”
- c - 在 if/else 中使用几乎相同的语句减少 C 程序中的代码重复?
- sql - 在 SQL 中两列之间的模糊匹配中创建真/假列
- c++ - 让 Windows 10 讲述人说出一些文字