Push rejected, failed to compile Python app error Discord.py

送分小仙女□ 提交于 2020-12-15 05:27:19

问题


When I try to push my I get this error:

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'

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

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


回答1:


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.

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.



来源:https://stackoverflow.com/questions/62130814/push-rejected-failed-to-compile-python-app-error-discord-py

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!