安装后无法导入discord.py

时间:2020-10-19 12:46:21

标签: python discord discord.py discord.py-rewrite

这是显示已安装文件的终端:

C:\Users\alex\Documents\alex\codism\python\Pycharm\BotsOn>pip install discord.py
Requirement already satisfied: discord.py in c:\programdata\anaconda3\lib\site-packages (1.5.0)
Requirement already satisfied: aiohttp<3.7.0,>=3.6.0 in c:\programdata\anaconda3\lib\site-packages (from discord.py) (3.6.3)
Requirement already satisfied: multidict<5.0,>=4.5 in c:\programdata\anaconda3\lib\site-packages (from aiohttp<3.7.0,>=3.6.0->discord.py) (4.7.6)
Requirement already satisfied: async-timeout<4.0,>=3.0 in c:\programdata\anaconda3\lib\site-packages (from aiohttp<3.7.0,>=3.6.0->discord.py) (3.0.1)
Requirement already satisfied: chardet<4.0,>=2.0 in c:\programdata\anaconda3\lib\site-packages (from aiohttp<3.7.0,>=3.6.0->discord.py) (3.0.4)
Requirement already satisfied: yarl<1.6.0,>=1.0 in c:\programdata\anaconda3\lib\site-packages (from aiohttp<3.7.0,>=3.6.0->discord.py) (1.5.1)
Requirement already satisfied: attrs>=17.3.0 in c:\programdata\anaconda3\lib\site-packages (from aiohttp<3.7.0,>=3.6.0->discord.py) (19.3.0)
Requirement already satisfied: idna>=2.0 in c:\programdata\anaconda3\lib\site-packages (from yarl<1.6.0,>=1.0->aiohttp<3.7.0,>=3.6.0->discord.py) (2.10)

以及当我:

import discord

Traceback (most recent call last):
  File "C:\Users\alex\Documents\alex\codism\python\Pycharm\BotsOn\SweepeyTesting.py", line 1, in <module>
    import discord
ModuleNotFoundError: No module named 'discord'

1 个答案:

答案 0 :(得分:0)

您要在代码中导入discord并安装discord.py。

pip install discord

安装discord,然后将其导入。