while installing the module, i get this error
JavaScript
x
27
27
1
C:UsersUserDesktopTrial>pip install discordpy
2
Collecting discordpy
3
Using cached discordpy-0.1.1.tar.gz (1.3 kB)
4
Using legacy 'setup.py install' for discordpy, since package 'wheel' is not installed.
5
Installing collected packages: discordpy
6
Running setup.py install for discordpy error
7
ERROR: Command errored out with exit status 1:
8
command: 'c:usersuserappdatalocalprogramspythonpython38-32python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\User\AppData\Local\Temp\pip-install-ogovpl6m\discordpy_7005c477f7d447de9f394c1c31fd29bc\setup.py'"'"'; __file__='"'"'C:\Users\User\AppData\Local\Temp\pip-install-ogovpl6m\discordpy_7005c477f7d447de9f394c1c31fd29bc\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersUserAppDataLocalTemppip-record-t2eexxn7install-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersuserappdatalocalprogramspythonpython38-32Includediscordpy'
9
cwd: C:UsersUserAppDataLocalTemppip-install-ogovpl6mdiscordpy_7005c477f7d447de9f394c1c31fd29bc
10
Complete output (14 lines):
11
running install
12
Traceback (most recent call last):
13
File "<string>", line 1, in <module>
14
File "C:UsersUserAppDataLocalTemppip-install-ogovpl6mdiscordpy_7005c477f7d447de9f394c1c31fd29bcsetup.py", line 32, in <module>
15
setup(
16
File "c:usersuserappdatalocalprogramspythonpython38-32libdistutilscore.py", line 148, in setup
17
dist.run_commands()
18
File "c:usersuserappdatalocalprogramspythonpython38-32libdistutilsdist.py", line 966, in run_commands
19
self.run_command(cmd)
20
File "c:usersuserappdatalocalprogramspythonpython38-32libdistutilsdist.py", line 985, in run_command
21
cmd_obj.run()
22
File "C:UsersUserAppDataLocalTemppip-install-ogovpl6mdiscordpy_7005c477f7d447de9f394c1c31fd29bcsetup.py", line 20, in run
23
raise Exception("You probably meant to install and run discord-py")
24
Exception: You probably meant to install and run discord-py
25
----------------------------------------
26
ERROR: Command errored out with exit status 1: 'c:usersuserappdatalocalprogramspythonpython38-32python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\User\AppData\Local\Temp\pip-install-ogovpl6m\discordpy_7005c477f7d447de9f394c1c31fd29bc\setup.py'"'"'; __file__='"'"'C:\Users\User\AppData\Local\Temp\pip-install-ogovpl6m\discordpy_7005c477f7d447de9f394c1c31fd29bc\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersUserAppDataLocalTemppip-record-t2eexxn7install-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersuserappdatalocalprogramspythonpython38-32Includediscordpy' Check the logs for full command output.
27
and to double check when i try running with this code-
JavaScript
1
10
10
1
from discord.ext import commands
2
code=commands.Bot(command_prefix='*')
3
@client.event
4
async def when_ready():
5
print("Bot is ready")
6
@client.command()
7
async def hello(abcd):
8
await abcd.send("Hi")
9
client.run('the bot token, cant share')
10
the error was shown to me was this
JavaScript
1
4
1
File "C:UsersUserDesktopTrialbot.py", line 4, in <module>
2
@client.event
3
NameError: name 'client' is not defined
4
pls help out , so i need to spam so that my question get subbmitted and i dont get a error regarding that your post is mostly code , please add some more details?
Advertisement
Answer
- its
discord.py
sopip install -U discord.py
- You use whatever you define
Client
orBot
to, so it will be@code.event
,@code.command()
and so