SSL:CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:11

2023-05-13Python开发问题
1703

free vpn 本文介绍了SSL:CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108) Discord/python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧! vpn下载 free vpn vpn free

问题描述

vpn free 限时送ChatGPT账号..

我正在使用 Pycharm 和 python 3.8 以及最新版本的不和谐.我试图运行这个脚本,但得到了这个错误.任何人都可以帮忙吗?

I'm using Pycharm and python 3.8 and latest version 免费vpn of discord. I tried to run this script but 免费vpn got this error. Can anyone help?

import discord

TOKEN = 'xxxxx'

client = discord.Client()

@client.event
async def on_message(message):
    # we do not want 免费vpn the bot to reply to 免费vpn下载 itself
    if 免费vpn message.author == client.user:
        return

    if message.content.startswith('!hello'):
 免费vpn   免费vpn      msg = 'Hello {0.author.mention}'.format(message)
        免费vpn await client.send_message(message.channel, 免费vpn msg)

@client.event
async def on_ready():
    print('Logged in as')
    免费vpn print(client.user.name)
  免费vpn下载   print(client.user.id)
    print('------')

client.run(TOKEN)

----- 下面错误-------

------ error below -------

/Users/mellie/PycharmProjects/Dominations/venv/bin/python/Users/mellie/PycharmProjects/Dominations/Domi.py Traceback(大多数最近通话最后):文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py",第 936 行,在 _wrap_create_connectionreturn await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa File"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py",第 vpn下载 1042 行,在 create_connection 中传输,协议=等待self._create_connection_transport(文件"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py",第 1072 行,在 _create_connection_transport 中等待服务员文件/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/sslproto.py",第 529 行,在 data_received 中ssldata,appdata = free vpn self._sslpipe.feed_ssldata(数据)文件/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/sslproto.py",第 189 免费vpn vpn下载 行,在 feed_ssldata 中self._sslobj.do_handshake() 文件/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py",第 944 行,在 do_handshake 中self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108)

/Users/mellie/PycharmProjects/Dominations/venv/bin/python /Users/mellie/PycharmProjects/Dominations/Domi.py Traceback (most recent call last): File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py", line 936, in _wrap_create_connection vpn下载 return await self._loop.create_connection(*args, **kwargs) # type: ignore vpn下载 # noqa vpn free 免费vpn下载 File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 1042, in create_connection vpn下载 transport, protocol = await self._create_connection_transport( File vpn vpn下载 free "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 1072, in _create_connection_transport await waiter File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/sslproto.py", line 529, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/sslproto.py", line 189, in feed_ssldata vpn free self._sslobj.do_handshake() vpn下载 File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 944, vpn free in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] vpn 免费vpn free certificate free vpn verify failed: unable to get local issuer certificate (_ssl.c:1108)

上述异常是以下异常的直接原因:

The above exception was the direct cause of the vpn下载 following exception:

Traceback(最近一次调用最后一次):文件/Users/mellie/PycharmProjects/Dominations/Domi.py",第 24 行,在client.run(TOKEN) 文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/client.py",第 640 行,运行中返回 future.result() 文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/client.py",第 621 行,在亚军中等待 self.start(*args, **kwargs) 文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/client.py",第 584 行,开始等待 self.login(*args, bot=bot) 文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/client.py",第 442 行,登录等待self.http.static_login(token.strip(),bot = bot)文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/http.py",第 256 行,在 vpn下载 免费vpn static_login 中数据 = 等待 self.request(Route('GET', vpn free '/users/@me')) 文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/http.py",第 160 行,应要求提供async with self.session.request(method, url, **kwargs) as r: vpn free File/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/client.py",第 1012 行,在 vpn下载 __aenterself._resp = 等待 self._coro 文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/client.py",第 480 行,在 _request 中conn =等待self._connector.connect(文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py",第 523 行,连接中proto = await self._create_connection(req, traces, timeout) 文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py",第 858 行,在 _create_connection 中_,原型 = 等待 self._create_direct_connection(文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py",第 1004 vpn下载 行,在 _create_direct_connection提出 last_exc 文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py",第 980 行,在 _create_direct_connection 中传输,原型 = 等待 self._wrap_create_connection(文件/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py",第 938 行,在 vpn下载 _wrap_create_connection引发 ClientConnectorCertificateError(aiohttp.client_exceptions.ClientConnectorCertificateError:不能连接到主机 discordapp.com:443 ssl:True [SSLCertVerificationError:(1, '[SSL: 免费vpn下载 CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108)')]

Traceback (most recent call last): File "/Users/mellie/PycharmProjects/Dominations/Domi.py", line 24, in 免费vpn下载 client.run(TOKEN) File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/client.py", line 640, in run 免费vpn return future.result() File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/client.py", line 621, in runner await self.start(*args, **kwargs) File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/client.py", line 584, in start vpn free await self.login(*args, bot=bot) File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/client.py", line vpn free 442, in login await self.http.static_login(token.strip(), bot=bot) File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/http.py", line 256, in static_login data = await self.request(Route('GET', '/users/@me')) File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/discord/http.py", vpn free line 160, in request 免费vpn free vpn async with self.session.request(method, url, **kwargs) as r: File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/client.py", line 1012, in __aenter 免费vpn self._resp vpn下载 = await self._coro File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/client.py", line 480, in _request conn = vpn free await self._connector.connect( File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py", line 523, in connect proto = await self._create_connection(req, traces, timeout) File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py", line free vpn 858, in _create_connection vpn free 免费vpn _, 免费vpn下载 proto vpn free = await self._create_direct_connection( File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py", line 1004, in _create_direct_connection vpn free 免费vpn raise last_exc File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py", line 980, in _create_direct_connection transp, proto = await free vpn self._wrap_create_connection( vpn free File "/Users/mellie/PycharmProjects/Dominations/venv/lib/python3.8/site-packages/aiohttp/connector.py", line 938, in _wrap_create_connection raise ClientConnectorCertificateError( aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host 免费vpn discordapp.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate 免费vpn (_ssl.c:1108)')]

进程以退出代码 1 结束

Process vpn下载 finished with exit code 1

推荐答案

这个github问题这里.说:

This github issue here. Says:

基本上导航到您的 Applications/Python 3.6/文件夹并加倍单击 Install Certificates.command.

Basically navigate to your Applications/Python 3.6/ folder and double 免费vpn下载 click the vpn下载 Install Certificates.command.

尝试在 3.6 上运行相同的程序并运行安装证书命令.这可能会解决您的问题

Try running this same program on 3.6 and run the install certificates vpn下载 command. This 免费vpn下载 is likely to solve your issue

这篇关于SSL:CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 free vpn (_ssl.c:1108) Discord/python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

在xarray中按单个维度的多个坐标分组
groupby 免费vpn下载 multiple 免费vpn coords along a free vpn single dimension in xarray(在xarray中按单个维度的多个坐标分组)...
vpn free 2024-08-22 Python开发问题
15

Pandas中的GROUP BY AND SUM不丢失列
Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)...
vpn下载 2024-08-22 Python开发问题
17

pandas 有从特定日期开始的按月分组的方式吗?
Is there a way of group by month in Pandas starting vpn下载 at specific day number?( pandas 有从特定日期开始的按月分组的方式吗?)...
2024-08-22 Python开发问题
10

GROUP BY+新列+基于条件的前一行抓取值
Group by + New Column + vpn下载 free vpn Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)...
2024-08-22 Python开发问题
18

PANDA中的Groupby算法和插值算法
Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)...
2024-08-22 Python开发问题
11

PANAS-基于列对行进行分组,并将NaN替换为非空值
Pandas vpn free - Group Rows based on a column and replace NaN with 免费vpn下载 non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)...
2024-08-22 Python开发问题
10