Import discord problems

anyone know how to fix this issue??

My Code:

import discord
from discord.ext import commands
import random
from discord import Permissions
from colorama import Fore, Style
import asyncio

ERROR MESSAGE GIVEN:

 Traceback (most recent call last):
  File "main.py", line 1, in <module>
    import discord
ModuleNotFoundError: No module named 'discord'

Hi, there @KadenNelson1,

I’ve never used the discord module before, but doesn’t seem like it is built in. However, Replit allows you to install packages using the package manager. Simply search for the necessary package, and click install. Alternatively, you can also use the shell found next to the console tab to install it like this: (assuming this is the module you are talking about) pip install discord.py (if the shell isn’t open, you can open it by pressing “+” and searching “Shell”)

Hope this solves your problem.

1 Like

I already have those installed and it still isn’t working… I’m seeing if its my “intent” code.

I’ve installed the discord and discord.py modules, but my Repl doesn’t seem to have any issues importing. Could you provide me a link to your repl?

@bobbypac This is probably what they’re talking about: https://replit.com/@KadenNelson1/discord-nuker?v=1#main.py

Edit: Got the mentions wrong (again lol)

1 Like

Nix is going absolutely crazy when running from the cover.

1 Like

@KadenNelson1 Just download all your code and reupload it in a new Python project EXCEPT the .nix and .replit files. (that fixes nix errors for me)

2 Likes

Just a tip of advise, start to using the “Secret” function to hide your tokens from your main code.

3 Likes

from discord.ext import commands

there is a problem with discor.ext or commands, the compiler give me a:“commands” is unknown import symbol

Python is interpreted, not compiled :upside_down_face:

Could you provide your entire code?