Python heroku应用程序与buildpack不兼容

2024-06-30 17:10:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我阅读了之前所有关于它的帖子,但仍然无法纠正它。我在Heroku创建的计算机目录中添加了requirements.txt和Procfile。Procfile读取“web:python聊天服务器.py”。还将runtime.txt添加到读取“python-3.6.2”的同一目录中。但是,它在命令提示符中再次给出相同的错误。我怎样才能解决这个问题?这是完整的错误消息:

“C:\Users\asus\chat\u server>;git push heroku master 计数对象:6,完成。 增量压缩最多使用4个线程。 压缩对象:100%(4/4),完成。 书写对象:100%(6/6),1.14kib | 585.00kib/s,完成。 总计6(增量1),重复使用0(增量0) 远程:压缩源文件…完成。 远程:建筑源: 远程: 远程:---->;应用程序与buildpack不兼容:https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/python.tgz 远程:更多信息:https://devcenter.heroku.com/articles/buildpacks#detection-failure 远程: 远程:!推送失败 远程:正在验证部署。。。 远程: 远程:!拒绝推送到BOOTH-stream-15219。 远程: 至https://git.heroku.com/boiling-stream-15219.git ![remote rejected]master->;master(拒绝预接收挂钩) 错误:无法将某些引用推送到“https://git.heroku.com/boiling-stream-15219.git


Tags: 对象httpsgitgtmaster目录txtcom
2条回答

除了JaredH的答案之外,在运行git push heroku master之前,确保当前分支是主分支

阅读本文的任何人:您将需要两个文件:

第一个文件: requirements.txt包含以下内容: gunicorn==19.7.1 或者不管pip freeze > requirements.txt的结果是什么

第二个文件: Procfile包含以下内容: web: gunicorn app:app 或者可能是空白。注意,本例中的app:app是对python文件名的引用。这意味着每次声明web进程并启动此类型的dyno时,也要运行命令gunicorn app:app来启动web服务器

然后git add .git commit -m "added Procfile and requirements.txt"

然后运行git push heroku master从本地master分支推送到heroku远程

相关问题 更多 >