4
4
4eeh2022-02-05 00:26:58
Python
4eeh, 2022-02-05 00:26:58

What is wrong with discord.py?

Just started to master discord.py, wrote test code

import discord
from discord.ext import commands

bot = commands.Bot(command_prefix='>')

@bot.command()
async def ping(ctx):
    await ctx.send('pong')

bot.run('тут мой токен')


writes:
C:\Users\User>D:\Downloads\s.py
Traceback (most recent call last):
File "D:\Downloads\s.py", line 1, in
import discord
File "D:\Downloads\ discord.py", line 2, in
from discord.ext import commands
ModuleNotFoundError: No module named 'discord.ext'; 'discord' is not a package

here is my pip list, all required modules are installed:
aiohttp 3.7.4.post0
altgraph 0.17.2
astunparse 1.6.3
async-timeout 3.0.1
attrs 21.4.0
braceexpand 0.1.7
cffi 1.15.0
chardet 4.0.0
click 8.0.3
colorama 0.4.4
discord 1.7.3
discord-ext-bot 0.0.6rc1
discord.py 1.7.3
future 0.18.2
idna 3.3
import-expression 1.1.4
jishaku 2.3.2
multidict 6.0.2
pefile 2021.9.3
pip 19.2.3
pycparser 2.21
pyinstaller 4.9
pyinstaller-hooks-contrib 2022.0
PyNaCl 1.4.0
pywin32-ctypes 0.2.0
setuptools 41.2.0
six 1.16.0
typing-extensions 4.0.1
wheel 0.37.1
yarl 1.7.2

Answer the question

In order to leave comments, you need to log in

2 answer(s)
4
4eeh, 2022-02-05
@4eeh

The guys decided everything, I just had to transfer the file to a separate folder, deleted discord.ext, downloaded it in the hope that it would help

S
soremix, 2022-02-05
@SoreMix

1. Somehow there are a lot of libraries, discord-ext-botyou can definitely delete them. Just discord, in theory, too, just enough discord.py
2. No need to store files with the name in the same folderdiscord.py

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question