I'd rather not use the python command. It's just points to the latest installed version and it doesn't even work on my pc. Use something like py -3.7 -m pip uninstall discord and py -3.7 -m pip install discord.py, since this will point to the specified python version and will use the pylauncher that installs with any installation of python3.
The Python ModuleNotFoundError: No module named 'discord' occurs when we forget to install the `discord.py` module before importing it. You both likely have a folder named discord in your project folder. Delete it.
Rerun the command. This is probably a case of local overrides. To verify, move out of your project directory entirely and run the following commands: python3 import discord If this works with no errors, you have a local override in your project.
Delete the discord folders in there. This is supposed to import the discord library into your (virtual) environment. However, it only throws the following ImportError: No module named discord.
This guide explains to install discord.py in various environments: Windows, macOS, Linux, Visual Studio Code, PyCharm, Anaconda, and Jupyter Notebook. We'll cover basic installation, voice support, troubleshooting common installation problems, and how to resolve the dreaded "ModuleNotFoundError: No module named 'discord'". Encountering a `Syntax Error` when importing the Discord library in the command line but not in VS Code? This guide will help you troubleshoot the issue effectively.
import discord from discord.ext import commands intents = discord.Intents.default() intents.message_content = True bot = commands.Bot(command_prefix='>', intents=intents) @bot.command() async def ping(ctx): await ctx.send('pong') bot.run('token'). The import discord could not be resolved error is a common error that can occur when you try to import a Discord bot into your project. However, by following the steps in this guide, you can easily fix this error and get your Discord bot up and running.
It says that discord does not exist as an import despite discord.py existing in requirements.txt Troubleshooting and help help Bran_Muffins April 15, 2025, 6:01am. There have been suggestions to disable Windows Defender until pip's installed and working, but that's a little unsafe. However, you could try free anti-virus, even if it's used only so that you can temporarily disable Windows Defender without risk.