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
Post a Comment