【问题标题】:remote: -----> App not compatible with buildpack: heroku error while hosting a discord bot远程:-----> 应用程序与 buildpack 不兼容:托管不和谐机器人时出现 heroku 错误
【发布时间】:2021-12-15 14:51:07
【问题描述】:

我想在 heroku 上托管我的 discord 机器人

i have followed and youtube video till here

但我不知道如何解决这个错误

完整

Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 4 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (6/6), 2.68 KiB | 2.68 MiB/s, done.
Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/python
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 0f11b1acbc6bdb39c6ea1fc83fa514db48551dfe
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 0f11b1acbc6bdb39c6ea1fc83fa514db48551dfe
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote: 
remote: Verifying deploy...
remote: 
remote: !   Push rejected to bruh-bot-7869.
remote: 
To https://git.heroku.com/bruh-bot-7869.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/bruh-bot-7869.git'

我在文件夹中有 2 个文件:-

main.py

rr.json

两者都很重要

在 Procfile 中:-

worker: python main.py

和 requirements.txt :-

git+https://github.com/Rapptz/discord.py@rewrite

我不知道该怎么办 请帮忙!

【问题讨论】:

  • 我用谷歌搜索了很多次,但对我没有任何帮助:(
  • 您的文件夹中有 requirements.txt 吗?
  • 是的,看看我所说的问题,我的 requiremnets.txt 中有什么
  • 你使用了 pip freeze > requirements.txt 吗? procfile 和 requirements 内容都很奇怪
  • 以我的项目为例,我的 Procfile 是: web: gunicorn .wsgi --log-file - 要求是我所有导入的列表

标签: python heroku discord.py


【解决方案1】:

我不知道是什么问题 但我将文件上传到 github 并将 heroku github 连接到 heroku 和部署

我在 requirements.txt 中做错了 100%

当我使用 pip3 freeze(cmets 中的 Marrows 告诉我)并将所有内容添加到 requirements.txt 并上传到 github 时。

然后部署机器人后一切正常。谢谢:)

【讨论】:

    猜你喜欢
    • 2018-02-16
    • 1970-01-01
    • 2020-10-03
    • 2018-01-22
    • 2021-11-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多