Discord.py不导入(没有名为' mysql'的模块)

时间:2017-10-09 20:00:52

标签: python python-3.x import python-import

当我尝试导入不和谐时,我收到错误;

>>> import discord
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import discord
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/__init__.py", line 20, in <module>
    from .client import Client, AppInfo, ChannelPermissions
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/client.py", line 42, in <module>
    from .voice_client import VoiceClient
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/voice_client.py", line 43, in <module>
    import websockets
  File "/Users/user1/Documents/websockets.py", line 1, in <module>
    import mysql.connector
ModuleNotFoundError: No module named 'mysql'

我的python版本的详细信息 Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin 可能有文件覆盖mysql吗?

1 个答案:

答案 0 :(得分:0)

看起来我制作的名为@RestController的文件与模块冲突。我删除了它,一切正常。