首页 > 解决方案 > 远程:-----> 应用程序与 buildpack 不兼容:托管不和谐机器人时出现 heroku 错误

问题描述

我想在 heroku 上托管我的不和谐机器人

我一直关注和 youtube 视频直到这里

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

满的

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 个文件:-

主文件

rr.json

两者都很重要

并在 Procfile 中:-

worker: python main.py

和 requirements.txt :-

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

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

标签: pythonherokudiscord.py

解决方案


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

我在 requirements.txt 中做错了 100%

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

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


推荐阅读