拒绝 Heroku 推送

时间:2021-05-04 22:28:22

标签: python heroku

我不知道为什么这个 heroku 推送不起作用。

我正在尝试推送一个 Python 脚本,该脚本是使用 pygame 库开发的 Snake Game。

使用 git push heroku master 命令

我收到此回复

Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 12 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (8/8), 6.00 KiB | 6.00 MiB/s, done.
Total 8 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/python
remote: -----> Python app detected
remote: -----> No Python version was specified. Using the buildpack default: python-3.9.5
remote:        To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.9.5
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        ERROR: Could not find a version that satisfies the requirement python-3.7.2 (from -r /tmp/build_85605c02/requirements.txt (line 1)) (from versions: none)
remote:        ERROR: No matching distribution found for python-3.7.2 (from -r /tmp/build_85605c02/requirements.txt (line 1))
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 670f2543a9261d8b214f620cbcd3982830890dc7
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 670f2543a9261d8b214f620cbcd3982830890dc7
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 snake-game-nick.
remote:

我的 requirements.txt 文件包含以下数据:

python-3.7.2

1 个答案:

答案 0 :(得分:1)

python 版本 (python-3.7.2) 不在 requirements.txt 中,而是在 runtime.txt(docs) 中。 requirements.txt 用于 PyPI 的依赖项。