Issue
I have a small question, my Discord bot is written in Python and I keep getting errors. This is the code of my bot:
import discord
import asyncio
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.content.startswith('!test'):
await client.send_message(message.channel, 'Calculating messages...')
client.run('You arent gonna get my token =D')
And when I run it this error comes:
Traceback (most recent call last):
File "C:\Users\DELL\Documents\Testing\discordbt.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
I really don't know what to do, all I did is the following commands in CMD:
pip install discord.py
pip install asyncio
That's all, I made sure the modules installed without errors, and they did, everything is up and such, and I know you need some other "programs" and I have installed the following programs: Python 3.6.3 64x
and Python 3.7.0a2 64x
My PC is from a 64x bit architecture so it completely matches.
Solution
It is possible that pip is installing the module in a foreign directory to the python version you run your script with. Try specifying the python version by appending the version number to the terminal command as such python3.6 -m pip install discord.py
. If that doesn't work try using pip3
instead of pip
.
edit: Also do not try to install asyncio
, it's part of the standard library.
Answered By - Exa
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.