Python 中有一个简单的 echobot,它可以工作并从 PyCharm 开始。问题出在 Heroku 上的部署中,在我的文件夹中有一个脚本,一个带有脚本配置的文件,runtime.txt 支持 3.7.2
- 脚本
- 脚本的配置文件
runtime.txt
支持 Python 3.7.2requirements.txt
通过pip install -r requirements.txt
procfile
,包含worker: python bot.py
(bot.py - 脚本的主体,指的是config.py,其中bot令牌位于tg中).gitignore
.git
有2种情况,或者我只是尝试通过部署应用程序git push heroku master
并得到错误
! No default language could be detected for this app.
HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
See https://devcenter.heroku.com/articles/buildpacks
! Push failed
如果我安装 Python buildpack,例如,通过设置中的站点和我的应用程序的页面,则会出现不同的错误:
-----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
! Push failed
我似乎在按照 Heroku 的指示做所有事情,但是,显然,我在某个地方弄错了,告诉我什么。
发现一个错误,需要通过添加
Procfile
,requirements.txt
和runtime.txt
到仓库git commit
并且
Procfile
必须不安装在存储库文件夹中,而是安装在根文件夹中(例如 D:\Procfile),因为 Heroku 只有在根文件夹中才能看到该文件