Skip to main content

Issue hosting Discord bot on Heroku. Extension 'cogs.meme' raised an error: ModuleNotFoundError: No module named 'asyncpraw'

Hey I'm having a hard time figuring out what to do.

When I try to host my bot I keep getting the error as it can't find the asyncpraw (reddit API) module.

Extension 'cogs.meme' raised an error: ModuleNotFoundError: No module named 'asyncpraw'

even though I have included it in my requirements.txt file and also set my python version to 3.9.7

Heroku Logs

2021-09-28T19:00:46.111355+00:00 app[worker.1]: meme
2021-09-28T19:00:46.112752+00:00 app[worker.1]: Traceback (most recent call last):
2021-09-28T19:00:46.112791+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 606, in _load_from_module_spec
2021-09-28T19:00:46.113156+00:00 app[worker.1]: spec.loader.exec_module(lib)
2021-09-28T19:00:46.113176+00:00 app[worker.1]: File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-09-28T19:00:46.113327+00:00 app[worker.1]: File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-09-28T19:00:46.113411+00:00 app[worker.1]: File "/app/cogs/meme.py", line 6, in <module>
2021-09-28T19:00:46.113552+00:00 app[worker.1]: import asyncpraw
2021-09-28T19:00:46.113617+00:00 app[worker.1]: ModuleNotFoundError: No module named 'asyncpraw'
2021-09-28T19:00:46.113629+00:00 app[worker.1]:
2021-09-28T19:00:46.113630+00:00 app[worker.1]: The above exception was the direct cause of the following exception:
2021-09-28T19:00:46.113630+00:00 app[worker.1]:
2021-09-28T19:00:46.113643+00:00 app[worker.1]: Traceback (most recent call last):
2021-09-28T19:00:46.113658+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 606, in _load_from_module_spec
2021-09-28T19:00:46.113981+00:00 app[worker.1]: spec.loader.exec_module(lib)
2021-09-28T19:00:46.113997+00:00 app[worker.1]: File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2021-09-28T19:00:46.114088+00:00 app[worker.1]: File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2021-09-28T19:00:46.114171+00:00 app[worker.1]: File "/app/cogs/help.py", line 2, in <module>
2021-09-28T19:00:46.114343+00:00 app[worker.1]: import main
2021-09-28T19:00:46.114356+00:00 app[worker.1]: File "/app/main.py", line 35, in <module>
2021-09-28T19:00:46.114497+00:00 app[worker.1]: client.load_extension(f'cogs.{filename[:-3]}')
2021-09-28T19:00:46.114512+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 663, in load_extension
2021-09-28T19:00:46.114857+00:00 app[worker.1]: self._load_from_module_spec(spec, name)
2021-09-28T19:00:46.114872+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 609, in _load_from_module_spec
2021-09-28T19:00:46.115258+00:00 app[worker.1]: raise errors.ExtensionFailed(key, e) from e
2021-09-28T19:00:46.115352+00:00 app[worker.1]: discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.meme' raised an error: ModuleNotFoundError: No module named 'asyncpraw'
2021-09-28T19:00:46.115364+00:00 app[worker.1]:
2021-09-28T19:00:46.115365+00:00 app[worker.1]: The above exception was the direct cause of the following exception:
2021-09-28T19:00:46.115365+00:00 app[worker.1]:
2021-09-28T19:00:46.115387+00:00 app[worker.1]: Traceback (most recent call last):
2021-09-28T19:00:46.115408+00:00 app[worker.1]: File "/app/main.py", line 35, in <module>
2021-09-28T19:00:46.115570+00:00 app[worker.1]: client.load_extension(f'cogs.{filename[:-3]}')
2021-09-28T19:00:46.115584+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 663, in load_extension
2021-09-28T19:00:46.115932+00:00 app[worker.1]: self._load_from_module_spec(spec, name)
2021-09-28T19:00:46.115948+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 609, in _load_from_module_spec
2021-09-28T19:00:46.116269+00:00 app[worker.1]: raise errors.ExtensionFailed(key, e) from e
2021-09-28T19:00:46.116352+00:00 app[worker.1]: discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.help' raised an error: ExtensionFailed: Extension 'cogs.meme' raised an error: ModuleNotFoundError: No module named 'asyncpraw'
2021-09-28T19:00:46.414229+00:00 heroku[worker.1]: Process exited with status 1
2021-09-28T19:00:46.487773+00:00 heroku[worker.1]: State changed from up to crashed
2021-09-28T19:00:52.000000+00:00 app[api]: Build succeeded

Requirements.txt

aiofiles==0.6.0
aiohttp==3.7.4.post0
aiosqlite==0.17.0
async-generator==1.10
async-timeout==3.0.1
asyncio-extras==1.3.2
asyncpraw==7.4.0
asyncprawcore==2.3.0
attrs==21.2.0
beautifulsoup4==4.10.0
bs4==0.0.1
certifi==2021.5.30
chardet==4.0.0
charset-normalizer==2.0.6
discord==1.7.3
discord.py==1.7.3
idna==3.2
multidict==5.1.0
numpy==1.21.2
oauthlib==3.1.1
pandas==1.3.3
python-dateutil==2.8.2
python-dotenv==0.19.0
pytz==2021.1
requests==2.26.0
requests-oauthlib==1.3.0
six==1.16.0
soupsieve==2.2.1
tweepy==4.0.0
typing-extensions==3.10.0.2
update-checker==0.18.0
urllib3==1.26.7
yarl==1.6.3


source https://stackoverflow.com/questions/69367417/issue-hosting-discord-bot-on-heroku-extension-cogs-meme-raised-an-error-modu

Comments

Popular posts from this blog

Confusion between commands.Bot and discord.Client | Which one should I use?

Whenever you look at YouTube tutorials or code from this website there is a real variation. Some developers use client = discord.Client(intents=intents) while the others use bot = commands.Bot(command_prefix="something", intents=intents) . Now I know slightly about the difference but I get errors from different places from my code when I use either of them and its confusing. Especially since there has a few changes over the years in discord.py it is hard to find the real difference. I tried sticking to discord.Client then I found that there are more features in commands.Bot . Then I found errors when using commands.Bot . An example of this is: When I try to use commands.Bot client = commands.Bot(command_prefix=">",intents=intents) async def load(): for filename in os.listdir("./Cogs"): if filename.endswith(".py"): client.load_extension(f"Cogs.{filename[:-3]}") The above doesnt giveany response from my Cogs ...

How to show number of registered users in Laravel based on usertype?

i'm trying to display data from the database in the admin dashboard i used this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count(); echo $users; ?> and i have successfully get the correct data from the database but what if i want to display a specific data for example in this user table there is "usertype" that specify if the user is normal user or admin i want to user the same code above but to display a specific usertype i tried this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count()->WHERE usertype =admin; echo $users; ?> but it didn't work, what am i doing wrong? source https://stackoverflow.com/questions/68199726/how-to-show-number-of-registered-users-in-laravel-based-on-usertype

Why is my reports service not connecting?

I am trying to pull some data from a Postgres database using Node.js and node-postures but I can't figure out why my service isn't connecting. my routes/index.js file: const express = require('express'); const router = express.Router(); const ordersCountController = require('../controllers/ordersCountController'); const ordersController = require('../controllers/ordersController'); const weeklyReportsController = require('../controllers/weeklyReportsController'); router.get('/orders_count', ordersCountController); router.get('/orders', ordersController); router.get('/weekly_reports', weeklyReportsController); module.exports = router; My controllers/weeklyReportsController.js file: const weeklyReportsService = require('../services/weeklyReportsService'); const weeklyReportsController = async (req, res) => { try { const data = await weeklyReportsService; res.json({data}) console...