推送被拒绝,无法编译Python应用程序错误Discord.py

时间:2020-06-01 11:08:22

标签: git heroku discord.py

当我尝试推动我时,出现此错误:

C:\Users\emirs\PycharmProjects\discordmasterbot>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是这样的:

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

我的程序的“导入”部分:

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可能有问题,这就是为什么我把我的整个导入部分都放在了

1 个答案:

答案 0 :(得分:3)

git+https://github.com/Rapptz/discord.py@rewrite不再存在,因为现在重写是master分支,并且不赞成使用异步版本(0.16.x)。

您可以将requirements.txt中的该行替换为discord.py==1.3.3(此答案时为最新版本),或从末尾删除@rewrite