Trying to run my .py file from CMD, but it can't find the discord module
>>File 'C:\Users\\****\Desktop\Discord_Bot\main.py', line 1, in module
>>import discord
>>ModuleNotFoundError: No module named 'discord'
Although, when I run:
>>python
>>import discord
It works as intended, any suggestions?
Windows InstallationOpen Command Prompt by typing cmd into Search. Install discord.py by using: py -3.6 -m pip install -U discord.py[voice] for voice support. py -3.6 -m pip install -U discord.py for without voice support.
discord.py does not support slash commands and will never add support for slash commands (as it has shut down) thus I recommend disnake (a popular fork).
Go into the terminal and use: pip uninstall discord.py
wait a few seconds so it can fully delete it, and then use pip install discord.py
. Should work
sudo pip install discord.py
solves the problem
Maybe it's the Python version issue.
When I tried running in python3.8 I got the same error. Switched over to 3.6 and it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With