Ask coding questions

← Back to all posts
" Package operation failed" on installing
danaragnarok (5)

I am trying to create a simple discord bot. I have tried importing it via the packages window, which gives the error " Package operation failed" and no other message. Adding it through requirements.txt does nothing. What else can I do?

Dart (1185)

you need to install this as well:
from discord.ext import commands, tasks
and in requirements.txt add

danaragnarok (5)

@Zexogon I already have in requirements.txt, as is specified in the question.

Dart (1185)

@danaragnarok try adding from discord.ext import commands, tasks

Dart (1185)

@danaragnarok importing discord works for me :/

mabey try making a new repl and copy pasting your code to see if it works

danaragnarok (5)

@Zexogon nope, same error message:
Traceback (most recent call last):
File "", line 3, in <module>
import discord
ModuleNotFoundError: No module named 'discord

It's a problem with installing the package, I think, not the imports I'm using, so I don't understand why adding an import would help.

Dart (1185)

@danaragnarok try copy pasting your code into a new repl and re importing everything

shraddha121 (0)

@Zexogon Still showing the same error

flysan (3)

@shraddha121 Were you able to solve the issue? I just happened to stumble on it as well