Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

urllib.error.URLError: <urlopen error [WinError 10054] 远程主机强迫关闭了一个现有的连接。> #47

Closed
zjrwtx opened this issue Dec 19, 2022 · 3 comments

Comments

@zjrwtx
Copy link

zjrwtx commented Dec 19, 2022

Traceback (most recent call last):
File "D:\python\lib\urllib\request.py", line 1348, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "D:\python\lib\http\client.py", line 1282, in request
self._send_request(method, url, body, headers, encode_chunked)
File "D:\python\lib\http\client.py", line 1328, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "D:\python\lib\http\client.py", line 1277, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\python\lib\http\client.py", line 1037, in _send_output
self.send(msg)
File "D:\python\lib\http\client.py", line 975, in send
self.connect()
File "D:\python\lib\http\client.py", line 1454, in connect
self.sock = self._context.wrap_socket(self.sock,
File "D:\python\lib\ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "D:\python\lib\ssl.py", line 1071, in _create
self.do_handshake()
File "D:\python\lib\ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\python\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\python\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "D:\python\lib\site-packages\pyChatGPT_main
.py", line 12, in
chat = ChatGPT(session_token)
File "D:\python\lib\site-packages\pyChatGPT\pyChatGPT.py", line 70, in init
self.__init_browser()
File "D:\python\lib\site-packages\pyChatGPT\pyChatGPT.py", line 112, in _init_browser
self.driver = uc.Chrome(options=options, enable_cdp_events=True)
File "D:\python\lib\site-packages\undetected_chromedriver_init
.py", line 242, in init
patcher.auto()
File "D:\python\lib\site-packages\undetected_chromedriver\patcher.py", line 127, in auto
release = self.fetch_release_number()
File "D:\python\lib\site-packages\undetected_chromedriver\patcher.py", line 148, in fetch_release_number
return LooseVersion(urlopen(self.url_repo + path).read().decode())
File "D:\python\lib\urllib\request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "D:\python\lib\urllib\request.py", line 519, in open
response = self._open(req, data)
File "D:\python\lib\urllib\request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "D:\python\lib\urllib\request.py", line 496, in _call_chain
result = func(*args)
File "D:\python\lib\urllib\request.py", line 1391, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "D:\python\lib\urllib\request.py", line 1351, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [WinError 10054] 远程主机强迫关闭了一个现有的连接。>

@zjrwtx
Copy link
Author

zjrwtx commented Dec 19, 2022

how to solve it?

@DevRoss
Copy link
Contributor

DevRoss commented Dec 21, 2022

The possible reason is that the network is not stable or the OpenAI does not support the country, try to use proxy.

@zjrwtx
Copy link
Author

zjrwtx commented Dec 22, 2022

The possible reason is that the network is not stable or the OpenAI does not support the country, try to use proxy.

i have solve it , thanks

@zjrwtx zjrwtx closed this as completed Dec 22, 2022
@terry3041 terry3041 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants