Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 拒绝Heroku推送_Python_Heroku - Fatal编程技术网

Python 拒绝Heroku推送

Python 拒绝Heroku推送,python,heroku,Python,Heroku,我不明白为什么这个希罗库推不起作用 我正在尝试推出一个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 obje

我不明白为什么这个希罗库推不起作用

我正在尝试推出一个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:

python版本(
python-3.7.2
)没有进入
requirements.txt
,而是进入
runtime.txt
()
requirements.txt
是来自PyPI的依赖项。

如果有什么需要,我会在requirements.txt中添加什么?如果您依赖于任何第三方软件包,例如
bs4
请求
,它们会进入
requirements.txt
。明白了,所以我使用的是pygame、sys、random、math和time库。所以他们会在requirements.txt中加入各自的版本?只有
pygame
,其余的都是标准库的一部分,并且已经随Python一起提供了。嘿,我想我会问更多的时间。我的应用程序已成功部署,但现在我收到一个H14错误。我需要在我的目录中添加Procfile吗?Procfile的文件类型是什么?我在里面放什么?
python-3.7.2