discord.py导致导入错误

时间:2018-01-29 20:31:21

标签: python importerror discord

我正在尝试构建一个不和谐机器人,我有这个错误,我似乎无法弄清楚当我尝试导入discord.py时明确发生了

错误消息是:

Traceback (most recent call last):
File "C:/Users/Pastry/PycharmProjects/PastryBot/sample.py", line 1, in <module>
import discord
File "C:\Python35\lib\site-packages\discord\__init__.py", line 20, in <module>
from .client import Client, AppInfo, ChannelPermissions
File "C:\Python35\lib\site-packages\discord\client.py", line 28, in <module>
from .user import User
File "C:\Python35\lib\site-packages\discord\user.py", line 27, in <module>
from .utils import snowflake_time
File "C:\Python35\lib\site-packages\discord\utils.py", line 31, in <module>
import asyncio
File "C:\Python35\lib\asyncio\__init__.py", line 21, in <module>
from .base_events import *
File "C:\Python35\lib\asyncio\base_events.py", line 18, in <module>
import concurrent.futures
File "C:\Python35\lib\concurrent\futures\__init__.py", line 17, in <module>
from concurrent.futures.process import ProcessPoolExecutor
File "C:\Python35\lib\concurrent\futures\process.py", line 55, in <module>
from multiprocessing.connection import wait
File "C:\Python35\lib\multiprocessing\connection.py", line 18, in <module>
import tempfile
File "C:\Python35\lib\tempfile.py", line 45, in <module>
from random import Random as _Random
ImportError: cannot import name 'Random'

我也尝试在其文档页面上使用quickstart bot guide中的示例代码,并遇到了同样的错误。我认为这是我的discord.py版本的一个问题所以我试图更新它,然后重新运行该程序,但我仍然得到这个错误。有人可以帮助启发我吗?

1 个答案:

答案 0 :(得分:0)

您下载了discord.py库吗?这可能是问题所在。 asyncio库怎么样?这两个最有可能。