Я не понимаю, почему этот толчок героку не работает.

Я пытаюсь запустить один скрипт python, который представляет собой игру-змею, разработанную с помощью библиотеки pygame.

С помощью команды 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
0
nick_rinaldi 5 Май 2021 в 01:28

1 ответ

Лучший ответ

Версия python (python-3.7.2) не входит в requirements.txt, она входит в runtime.txt (документы). requirements.txt для зависимостей от PyPI.

1
SuperStormer 5 Май 2021 в 01:00