这是显示已安装文件的终端:
C:UsersalexDocumentsalexcodismpythonPycharmBotsOn>pip install discord.py
Requirement already satisfied: discord.py in c:programdataanaconda3libsite-packages (1.5.0)
Requirement already satisfied: aiohttp<3.7.0,>=3.6.0 in c:programdataanaconda3libsite-packages (from discord.py) (3.6.3)
Requirement already satisfied: multidict<5.0,>=4.5 in c:programdataanaconda3libsite-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:programdataanaconda3libsite-packages (from aiohttp<3.7.0,>=3.6.0->discord.py) (3.0.1)
Requirement already satisfied: chardet<4.0,>=2.0 in c:programdataanaconda3libsite-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:programdataanaconda3libsite-packages (from aiohttp<3.7.0,>=3.6.0->discord.py) (1.5.1)
Requirement already satisfied: attrs>=17.3.0 in c:programdataanaconda3libsite-packages (from aiohttp<3.7.0,>=3.6.0->discord.py) (19.3.0)
Requirement already satisfied: idna>=2.0 in c:programdataanaconda3libsite-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:UsersalexDocumentsalexcodismpythonPycharmBotsOnSweepeyTesting.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
您正在代码中导入discord并安装discord.py.
pip install discord
安装discord然后导入。