使用创建不协调bot时出错不和谐.py模块。我想这和使用水蟒的装置有关

2024-04-24 05:25:51 发布

您现在位置:Python中文网/ 问答频道 /正文

如果我用python运行以下代码,就会得到一个错误。你知道吗

import discord
from discord.ext import commands

TOKEN = "token"

client = commands.Bot(command_prefix = "rps/")

@client.event
async def on_ready():
    print ('ready')

client.run("token")

错误:

Traceback (most recent call last): File "/Users/timothy/Library/Python/3.6/lib/python/site-packages/aiohttp/connector.py", line 822, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 804, in create_connection sock, protocol_factory, ssl, server_hostname) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 830, in _create_connection_transport yield from waiter File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/sslproto.py", line 505, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/sslproto.py", line 201, in feed_ssldata self._sslobj.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users/timothy/Documents/coding stuff/python/Test bot/test bot.py", line 12, in client.run(TOKEN) File "/Users/timothy/Library/Python/3.6/lib/python/site-packages/discord/client.py", line 571, in run return task.result() File "/Users/timothy/Library/Python/3.6/lib/python/site-packages/discord/client.py", line 478, in start

我想这与我如何使用$conda install安装包有关不和谐.py. 有人知道我做错了什么吗?python确实能识别模块


Tags: inpyclientlibcreatelinelibraryframework