简体   繁体   中英

I Installed a Module Called Discord and When Using “import discord” I Get the Error: “ModuleNotFoundError: No module named 'discord'”

The module 'discord' I installed in the command prompt which I ran as administrator can't be found. It's located in my site-packages directory along with some other modules such as setuptools which when I import, are imported successfully without error. However, discord which is in the same directory doesn't. In the environment variables I have Path which I've specified to site-packages but I still receive the error that discord cannot be found.

That error is common on Python version 3.7

If you are trying to run your bot or discord app with Python 3.7 and getting an error such as Invalid Syntax, we recommend that you install Python 3.6.x instead. Discord.py isn't supported on 3.7 due to asyncio not supporting it. Remember to add Python to PATH!

Install an older version of PY to run discord!

As it says in the description of " discord ", This is a mirror package .

in my opinion, although it was supposed to install discord.py, it did not install. When you download the library through pip you should write pip install discord.py instead of pip install discord . Once you have downloaded discord.py you will be able to do import discord .

And also make sure your python version is Python 3.5.3 or higher .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM