【问题标题】:Heroku Failed PushHeroku 推送失败
【发布时间】:2021-12-30 15:35:52
【问题描述】:

我正在尝试使用以下命令向 heroku 推送一些东西:“git push heroku HEAD:main”

我在 CMD 中得到的错误是:

    "! [remote rejected] HEAD -> main (pre-receive hook declined)
      error: failed to push some refs to 'https://git.heroku.com/discordbotonline247.git'"
    
     And if i check Heroku logs i find this:
    -----> Building on the Heroku-20 stack
    
    -----> Using buildpack: heroku/python
    
    -----> Python app detected
    
    -----> No Python version was specified. Using the buildpack default: python-3.9.9
    
           To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
    
    -----> Installing python-3.9.9
    
    -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
    
    -----> Installing SQLite3
    
    -----> Installing requirements with pip
    
           Collecting git+https://github.com/Rapptz/discord.py@rewrite (from -r /tmp/build_3181f09c/requirements.txt (line 1))
    
             Cloning https://github.com/Rapptz/discord.py (to revision rewrite) to /tmp/pip-req-build-wpl2aq36
    
             Running command git clone --filter=blob:none -q https://github.com/Rapptz/discord.py /tmp/pip-req-build-wpl2aq36
    
             WARNING: Did not find branch or tag 'rewrite', assuming revision or ref.
    
             Running command git checkout -q rewrite
    
             error: pathspec 'rewrite' did not match any file(s) known to git
    
           WARNING: Discarding git+https://github.com/Rapptz/discord.py@rewrite. Command errored out with exit status 1: git checkout -q rewrite Check the logs for full command output.
    
           ERROR: Command errored out with exit status 1: git checkout -q rewrite Check the logs for full command output.
    
     !     Push rejected, failed to compile Python app.
    
     !     Push failed

在我的 Procfile 中我有:

"worker: python Discord_Bot.py

在我的 requirements.txt 我有:

"git+https://github.com/Rapptz/discord.py@rewrite
 PyNaCl==1.3.0
 pandas
 dnspython==1.16.0
 async-timeout==3.0.1"

请帮忙!

【问题讨论】:

    标签: python heroku error-handling discord.py bots


    【解决方案1】:

    您需要删除 require.txt 文件中的引号以及 Github 链接中的 @rewrite。但是,不要删除@rewrite,只需指定不和谐版本。将您的 requirements.txt 文件替换为以下内容:

    discord.py==1.6.0
    PyNaCl==1.3.0
    pandas
    dnspython==1.16.0
    async-timeout==3.0.1
    

    【讨论】:

    • Tysm 或许你可以帮忙看看我发表的评论,在这里评论它太大了
    • @SdejSdeyt 首先,请通过单击否决按钮下方的复选标记将我的答案标记为正确,以便查看此问题的其他人知道此答案有效。其次,请将您的新问题作为单独的问题发布,而不是在此线程中。
    • 好的,我会这样做的
    • 快速评论!
    猜你喜欢
    • 2020-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-03
    • 2021-05-07
    相关资源
    最近更新 更多