【发布时间】:2020-11-18 15:39:56
【问题描述】:
这是完整的 cmd:
C:\Users\twori\Desktop\development\python\discord.py>git push heroku master
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.11
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting git+https://github.com/Rapptz/discord.py@rewrite (from -r /tmp/build_a16c861c/requirements.txt (line 1))
remote: Cloning https://github.com/Rapptz/discord.py (to revision rewrite) to /tmp/pip-req-build-622q7g33
remote: Running command git clone -q https://github.com/Rapptz/discord.py /tmp/pip-req-build-622q7g33
remote: WARNING: Did not find branch or tag 'rewrite', assuming revision or ref.
remote: Running command git checkout -q rewrite
remote: error: pathspec 'rewrite' did not match any file(s) known to git.
remote: ERROR: Command errored out with exit status 1: git checkout -q rewrite Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to discord-gut.
remote:
To https://git.heroku.com/discord-gut.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/discord-gut.git'
老实说,我对 GIT 一无所知,但我只是搜索了这个错误并尝试了所有方法。
请告诉我这有什么问题。
+) 我找到了这个:https://help.heroku.com/O0EXQZTA/how-do-i-switch-branches-from-master-to-main
我试过了,但我得到了相同的结果:
C:\Users\twori\Desktop\development\python\discord.py>git push heroku main
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 12 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (6/6), 683 bytes | 227.00 KiB/s, done.
Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.11
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting git+https://github.com/Rapptz/discord.py@rewrite (from -r /tmp/build_0ed9bf17/requirements.txt (line 1))
remote: Cloning https://github.com/Rapptz/discord.py (to revision rewrite) to /tmp/pip-req-build-bii5i34v
remote: Running command git clone -q https://github.com/Rapptz/discord.py /tmp/pip-req-build-bii5i34v
remote: WARNING: Did not find branch or tag 'rewrite', assuming revision or ref.
remote: Running command git checkout -q rewrite
remote: error: pathspec 'rewrite' did not match any file(s) known to git.
remote: ERROR: Command errored out with exit status 1: git checkout -q rewrite Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to discord-gut.
remote:
To https://git.heroku.com/discord-gut.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/discord-gut.git'
【问题讨论】:
-
您的问题是这个
Collecting git+https://github.com/Rapptz/discord.py@rewrite。编辑您的requirements.txt并将包含discord.py的行更改为仅discord.py或discord.py==1.3.4。 rewrite git 分支不再存在,现在是主分支。 -
我修改了 requirements.txt :
discord.py==1.3.4 git+https://github.com/Rapptz/discord.py@rewrite PyNaCl==1.3.0 pandas dnspython==1.16.0 async-timeout==3.0.1,它给了我同样的错误。 -
删除
git+https://github.com/Rapptz/discord.py@rewrite -
@TinNguyen :您可能应该重新发布您的评论作为答案
标签: python git heroku discord.py