问题描述
当我尝试推送时,我得到了这个错误:
When I try to push my I get this error:
C:UsersemirsPycharmProjectsdiscordmasterbot>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.10
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_9aeec3d177cff34ed7cd7b5bc8e84eca/requirements.txt (line 1))
remote: Cloning https://github.com/Rapptz/discord.py (to revision rewrite) to /tmp/pip-req-build-pexa63lg
build-pexa63lg
remote: Running command git clone -q https://github.com/Rapptz/discord.py /tmp/pip-req-
build-pexa63lg
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 discordmasterbot.
remote:
To https://git.heroku.com/discordmasterbot.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/discordmasterbot.git'
而我的 requirements.txt 是这样的:
And my requirements.txt is like that:
discord.py==1.3.3
PyNaCl==1.3.0
pandas
dnspython==1.16.0
async-timeout==3.0.1
还有我的程序导入"部分:
And my programs "import" section:
import json
import os
import random
import shutil
from os import system
from random import randint
import praw
import discord
import youtube_dl
from discord.ext import commands, tasks
from discord.utils import get
import aiohttp
from itertools import cycle
我真的很想在 Heroku 中托管我的机器人,但我不能!我认为这可能是 requirements.txt
的问题,所以这就是为什么我把我的整个导入部分
I really want to host my bot in Heroku, but I can't! I think that It might be a problem with the requirements.txt
and so thats why I've put my whole import section
推荐答案
git+https://github.com/Rapptz/discord.py@rewrite
不再存在,因为 rewrite 现在是master 分支和异步版本 (0.16.x) 已被弃用.
git+https://github.com/Rapptz/discord.py@rewrite
no longer exists, as rewrite is now the master branch and the async version (0.16.x) has been deprecated.
您可以将 requirements.txt
中的该行替换为 discord.py==1.3.3
(本答案时的最新版本)或删除 @rewrite
从最后.
You can just replace that line in requirements.txt
with discord.py==1.3.3
(most recent version at the time of this answer) or remove @rewrite
from the end.
这篇关于推送被拒绝,无法编译 Python 应用程序错误 Discord.py的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!