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

ValueError: X has 10 features, but LinearRegression is expecting 1 features as input

So, I am trying to predict the model but its throwing error like it has 10 features but it expacts only 1. So I am confused can anyone help me with it? more importantly its not working for me when my friend runs it. It works perfectly fine dose anyone know the reason about it? cv = KFold(n_splits = 10) all_loss = [] for i in range(9): # 1st for loop over polynomial orders poly_order = i X_train = make_polynomial(x, poly_order) loss_at_order = [] # initiate a set to collect loss for CV for train_index, test_index in cv.split(X_train): print('TRAIN:', train_index, 'TEST:', test_index) X_train_cv, X_test_cv = X_train[train_index], X_test[test_index] t_train_cv, t_test_cv = t[train_index], t[test_index] reg.fit(X_train_cv, t_train_cv) loss_at_order.append(np.mean((t_test_cv - reg.predict(X_test_cv))**2)) # collect loss at fold all_loss.append(np.mean(loss_at_order)) # collect loss at order plt.plot(np.log(al...

Sorting large arrays of big numeric stings

I was solving bigSorting() problem from hackerrank: Consider an array of numeric strings where each string is a positive number with anywhere from to digits. Sort the array's elements in non-decreasing, or ascending order of their integer values and return the sorted array. I know it works as follows: def bigSorting(unsorted): return sorted(unsorted, key=int) But I didnt guess this approach earlier. Initially I tried below: def bigSorting(unsorted): int_unsorted = [int(i) for i in unsorted] int_sorted = sorted(int_unsorted) return [str(i) for i in int_sorted] However, for some of the test cases, it was showing time limit exceeded. Why is it so? PS: I dont know exactly what those test cases were as hacker rank does not reveal all test cases. source https://stackoverflow.com/questions/73007397/sorting-large-arrays-of-big-numeric-stings

How to load Javascript with imported modules?

I am trying to import modules from tensorflowjs, and below is my code. test.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title </head> <body> <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@2.0.0/dist/tf.min.js"></script> <script type="module" src="./test.js"></script> </body> </html> test.js import * as tf from "./node_modules/@tensorflow/tfjs"; import {loadGraphModel} from "./node_modules/@tensorflow/tfjs-converter"; const MODEL_URL = './model.json'; const model = await loadGraphModel(MODEL_URL); const cat = document.getElementById('cat'); model.execute(tf.browser.fromPixels(cat)); Besides, I run the server using python -m http.server in my command prompt(Windows 10), and this is the error prompt in the console log of my browser: Failed to loa...