繁体   English   中英

Python heroku -app与buildpack不兼容

[英]Python heroku -app not compatible with buildpack

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

“C:\\ Users \\ asus \\ chat_server> git push heroku master计数对象:6,完成。使用最多4个线程进行增量压缩。压缩对象:100%(4/4),完成。写入对象:100%(6 / 6),1.14 KiB | 585.00 KiB / s,完成。总计6(增量1),重用0(delta 0)远程:压缩源文件...完成。远程:构建源:远程:远程:----- >应用程序与buildpack不兼容: https ://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/python.tgz remote:更多信息: https//devcenter.heroku.com/articles/buildpacks#detection-failure remote:remote:!推送失败的远程:验证部署...远程:远程:!推送拒绝到沸腾流-15219。远程:到https://git.heroku.com/boiling-stream-15219.git ![远程拒绝] master - > master(pre-receive hook拒绝)错误:无法将某些引用推送到' https://git.heroku.com/boiling-stream-15219.git '“

读这篇文章的人:你需要两个文件:

第一个文件: requirements.txt包含类似: gunicorn==19.7.1pip freeze > requirements.txt结果。

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

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM