到目前为止,它在 heroku 和本地都运行良好。现在它只能在本地工作,但在部署到 heroku 后不起作用。这是 Heroku 的日志:
2021-04-22T17:41:34.000000+00:00 app[api]: Build succeeded
2021-04-22T17:41:37.853181+00:00 heroku[worker.1]: Starting process with command `python3.9.4 dbot.py`
2021-04-22T17:41:38.485331+00:00 heroku[worker.1]: State changed from starting to up
2021-04-22T17:41:39.356992+00:00 app[worker.1]: bash: python3.9.4: command not found
2021-04-22T17:41:39.416346+00:00 heroku[worker.1]: Process exited with status 127
2021-04-22T17:41:39.485205+00:00 heroku[worker.1]: State changed from up to crashed
我有包含这些依赖项的 requirments.txt 文件:
git+https://github.com/Rapptz/discord.py
youtube_dl==2020.03.08
pynacl == 1.3.0
colorlog == 4.1.0
我的 procfile 中有这个:
worker: python3.9.4 dbot.py
就我所知,我认为这与我最近更新到 3.9.4 的 python 版本有关
答案 0 :(得分:0)
不要将 python 的版本放入 Procfile
中,只需输入:
worker: python dbot.py
如果您想为您的机器人指定 Python 版本,请使用以下格式创建一个 runtime.txt
文件
python-3.9.4