Q&A
Discord.pyを起動させようとするとこのようなエラーが出てきます。
おそらく、Python本体の方のエラーかと思われます。
何か対処法はありませんか?
Pythonのバージョンは3.9です。
何度もPythonの再インストールをしてます。
(Python関連のファイルをすべて削除してからPythonの再インストールしています)
OS : macOS10.15.7
python
1Traceback (most recent call last): 2 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection 3 return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa 4 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 1090, in create_connection 5 transport, protocol = await self._create_connection_transport( 6 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 1120, in _create_connection_transport 7 await waiter 8 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/sslproto.py", line 534, in data_received 9 ssldata, appdata = self._sslpipe.feed_ssldata(data) 10 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/sslproto.py", line 188, in feed_ssldata 11 self._sslobj.do_handshake() 12 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 944, in do_handshake 13 self._sslobj.do_handshake() 14ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129) 15 16The above exception was the direct cause of the following exception: 17 18Traceback (most recent call last): 19 File "/Users/a/Desktop/KinKinBot.py", line 21, in <module> 20 client.run("トークンが出てるので隠します") 21 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/client.py", line 723, in run 22 return future.result() 23 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/client.py", line 702, in runner 24 await self.start(*args, **kwargs) 25 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/client.py", line 665, in start 26 await self.login(*args, bot=bot) 27 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/client.py", line 511, in login 28 await self.http.static_login(token.strip(), bot=bot) 29 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/http.py", line 300, in static_login 30 data = await self.request(Route('GET', '/users/@me')) 31 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/http.py", line 192, in request 32 async with self.__session.request(method, url, **kwargs) as r: 33 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in __aenter__ 34 self._resp = await self._coro 35 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request 36 conn = await self._connector.connect( 37 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect 38 proto = await self._create_connection(req, traces, timeout) 39 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection 40 _, proto = await self._create_direct_connection(req, traces, timeout) 41 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection 42 raise last_exc 43 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection 44 transp, proto = await self._wrap_create_connection( 45 File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 971, in _wrap_create_connection 46 raise ClientConnectorCertificateError(req.connection_key, exc) from exc 47aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')]
回答1件
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
2022/04/12 10:22
2022/04/12 10:24