简体   繁体   中英

Uploading a discord bot (python) onto Heroku : App not compatible with buildpack error (I know its been asked a lot)

I'm currently trying to create a discord bot (in python) and having created a working local version, I want to upload it onto Heroku.

I've opted to connect it through github so I can push changes and have it automatically update, as opposed to going through the heroku github method of pushing changes.

I've been searching for an answer but nothing I do is helping. I admit I am quite new to this so maybe I have made a really silly mistake.

Every time I try to deploy branch I get the error that the App is not compatible with buildpack, I've tried every fix I could find online and have even tried the heroku github method of pushing changes using the heroku CLI, but nothing is working.

My repository currently consists of:

Bot.py (the discord bot script)

Procfile

worker: python Bot.py

Requirements.txt

pymongo==3.10.1
git+https://github.com/Rapptz/discord.py

runtime.txt

python-3.7.8

I experimented getting rid of pymongo in case that was causing the issue, but getting rid of it + removing everything in the in the bot script itself that referred to it, but I still get the same error.

I am using the python buildpack and the full error I get is

-----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz

       More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure

 !     Push failed

I have added two add-ons onto my app using the web-app (postgres and mLab) as I suspect I will want to use them as alternatives to my current setup for MongoDB access.

Perhaps I've done something silly but if anyone could help I would be really thankful!

How about you add discord.py to your requirements.txt because i can't see it there, it will build but can't run the bot.

discord.py==1.4.1 

Heroku supports pipenv , You can make the environment in your local machine at the same root directory so when you push to GitHub the environment files are there. no need for requirements.txt . Basic guide

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM