我安装了一个称为Discord的模块,并且在使用"import discord"时我收到错误消息:"ModuleNotFoundError:没有名为'discord'的模块" [英] I Installed a Module Called Discord and When Using "import discord" I Get the Error: "ModuleNotFoundError: No module named 'discord'"

查看:477
本文介绍了我安装了一个称为Discord的模块,并且在使用"import discord"时我收到错误消息:"ModuleNotFoundError:没有名为'discord'的模块"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

找不到以管理员身份运行的命令提示符中安装的模块"discord".它与其他一些模块(例如setuptools)一起位于我的site-packages目录中,在我导入时,这些模块可以成功导入而不会出现错误.但是,不在同一目录中的不和谐.在环境变量中,我有已指定给站点包的路径,但仍然收到无法找到不一致的错误.

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.

推荐答案

如" discord ",这是一个镜像包.

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

尽管应该安装discord.py,但没有安装. 通过pip下载库时,应写pip install discord.py而不是pip install discord. 下载discord.py后,您就可以执行import discord.

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.

还要确保您的python版本是 Python 3.5.3或更高版本.

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

这篇关于我安装了一个称为Discord的模块,并且在使用"import discord"时我收到错误消息:"ModuleNotFoundError:没有名为'discord'的模块"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆