Skip to content
Advertisement

cannot instal discord module properly

while installing the module, i get this error

C:UsersUserDesktopTrial>pip install discordpy
Collecting discordpy
  Using cached discordpy-0.1.1.tar.gz (1.3 kB)
Using legacy 'setup.py install' for discordpy, since package 'wheel' is not installed.
Installing collected packages: discordpy
    Running setup.py install for discordpy ... error
    ERROR: Command errored out with exit status 1:
     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'
         cwd: C:UsersUserAppDataLocalTemppip-install-ogovpl6mdiscordpy_7005c477f7d447de9f394c1c31fd29bc
    Complete output (14 lines):
    running install
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:UsersUserAppDataLocalTemppip-install-ogovpl6mdiscordpy_7005c477f7d447de9f394c1c31fd29bcsetup.py", line 32, in <module>
        setup(
      File "c:usersuserappdatalocalprogramspythonpython38-32libdistutilscore.py", line 148, in setup
        dist.run_commands()
      File "c:usersuserappdatalocalprogramspythonpython38-32libdistutilsdist.py", line 966, in run_commands
        self.run_command(cmd)
      File "c:usersuserappdatalocalprogramspythonpython38-32libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "C:UsersUserAppDataLocalTemppip-install-ogovpl6mdiscordpy_7005c477f7d447de9f394c1c31fd29bcsetup.py", line 20, in run
        raise Exception("You probably meant to install and run discord-py")
    Exception: You probably meant to install and run discord-py
    ----------------------------------------
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.

and to double check when i try running with this code-

from discord.ext import commands
code=commands.Bot(command_prefix='*')
@client.event
async def when_ready():
    print("Bot is ready")
@client.command()
async def hello(abcd):
    await abcd.send("Hi")
client.run('the bot token, cant share') 

the error was shown to me was this

  File "C:UsersUserDesktopTrialbot.py", line 4, in <module>
    @client.event
NameError: name 'client' is not defined

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

  1. its discord.py so pip install -U discord.py
  2. You use whatever you define Client or Bot to, so it will be @code.event, @code.command() and so
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement