【问题标题】:How can I fix this error while deploying my bot unto heroku?在将我的机器人部署到 heroku 时如何解决此错误?
【发布时间】:2021-10-11 17:42:26
【问题描述】:

我试图在 heroku 上部署一个机器人,我按照某人的教程进行操作。我以为我做的一切都是正确的,但它说我的推送失败了。有人可以帮忙吗?完全错误:

-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/python
-----> 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

对于我的构建包,我安装了 python,因为这就是我使用的,这是我的主要代码:

import discord import os
 
client = discord.Client()
 
@client.event async def on_ready():
    print("Bot is ready!")
 
client.run(os.environ['DISCORD_BOT_TOKEN'])

我还有一个需求文件,其中只有一行带有“discord” 最后,我有一个 procfile:

worker: python main.py

【问题讨论】:

    标签: python heroku discord


    【解决方案1】:

    默认情况下,它会尝试在可用的最高版本上构建它。 确保可以,如果没有在 runtime.txt 中定义版本。

    根据我的经验,我还需要将 uwsgi 添加到需求文件中。

    【讨论】:

      猜你喜欢
      • 2021-10-29
      • 2021-06-29
      • 1970-01-01
      • 2019-04-17
      • 1970-01-01
      • 2022-01-25
      • 2021-08-12
      • 2021-02-19
      • 1970-01-01
      相关资源
      最近更新 更多