gpt4 book ai didi

Python 3.5 connection.py : sock. connect(sa) ConnectionRefusedError: [Errno 111]

转载 作者:太空宇宙 更新时间:2023-11-04 10:44:54 26 4
gpt4 key购买 nike

我有一个 Python 3.5 脚本,可以从另一个 Linux 服务器中提取信息。必须先通过443端口建立连接。不幸的是,我收到以下错误消息:

我可以 ping 通 Linux 服务器,但出现以下错误:

Traceback (most recent call last):
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site- packages/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
body=body, headers=headers)
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site- packages/requests/packages/urllib3/connectionpool.py", line 341, in _make_request
self._validate_conn(conn)
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 761, in _validate_conn
conn.connect()
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 204, in connect
conn = self._new_conn()
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 134, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 88, in create_connection
raise err
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 78, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

最佳答案

问题是由我的/etc/hosts 文件中的重复 IP 地址引起的。一旦我删除了不正确的条目,一切都开始工作了。

关于Python 3.5 connection.py : sock. connect(sa) ConnectionRefusedError: [Errno 111],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33503781/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com