连接错误(由newconnectionerror引起)pipreqs

jm81lzqq  于 2021-08-25  发布在  Java
关注(0)|答案(1)|浏览(967)

我试着运行一个简单的 pipreqs 要查看代码中返回的所有包,请执行以下操作:

Traceback (most recent call last):
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\urllib3\connection.py", line 169, in _new_conn
    conn = connection.create_connection(
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\socket.py", line 953, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
    conn.connect()
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\urllib3\connection.py", line 353, in connect
    conn = self._new_conn()
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\urllib3\connection.py", line 181, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x000001D4275931C0>: Failed to establish a new connection: [Errno 11001] getaddrinfo f
ailed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\requests\adapters.py", line 439, in send
    resp = conn.urlopen(
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\urllib3\util\retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /pypi/PySimpleGUI/json (Caused by NewConnectionErro
r('<urllib3.connection.HTTPSConnection object at 0x000001D4275931C0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Gabri\PycharmProjects\pythonProject\venv\Scripts\pipreqs.exe\__main__.py", line 7, in <module>
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\pipreqs\pipreqs.py", line 470, in main
    init(args)
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\pipreqs\pipreqs.py", line 430, in init
    imports = local + get_imports_info(difference,
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\pipreqs\pipreqs.py", line 187, in get_imports_info
    response = requests.get(
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\requests\api.py", line 76, in get
    return request('get', url, params=params,**kwargs)
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url,**kwargs)
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\requests\sessions.py", line 542, in request
    resp = self.send(prep,**send_kwargs)
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\requests\sessions.py", line 655, in send
    r = adapter.send(request,**kwargs)
  File "c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages\requests\adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /pypi/PySimpleGUI/json (Caused by NewConnectionE
rror('<urllib3.connection.HTTPSConnection object at 0x000001D4275931C0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

昨天这个命令还有效,但今天不行,idk为什么
我试过了 pip3 install pipreqs --upgrade 这份申报表:

Requirement already satisfied: pipreqs in c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages (0.4.10)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTT
PSConnection object at 0x000001F5DE0E45E0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pipreqs/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTT
PSConnection object at 0x000001F5DE0D2220>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pipreqs/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTT
PSConnection object at 0x000001F5DE0D24F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pipreqs/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTT
PSConnection object at 0x000001F5DE0D2A60>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pipreqs/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTT
PSConnection object at 0x000001F5DE0D2B50>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pipreqs/
Requirement already satisfied: docopt in c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages (from pipreqs) (0.6.2)
Requirement already satisfied: yarg in c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages (from pipreqs) (0.1.9)
Requirement already satisfied: requests in c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages (from yarg->pipreqs) (2.25.1)
Requirement already satisfied: chardet<5,>=3.0.2 in c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages (from requests->yarg->pipreqs) (4.0.0)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages (from requests->yarg->pipreqs) (2020.12.5)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages (from requests->yarg->pipreqs) (1.26.4)
Requirement already satisfied: idna<3,>=2.5 in c:\users\gabri\pycharmprojects\pythonproject\venv\lib\site-packages (from requests->yarg->pipreqs) (2.10)

但它仍然不起作用

hfwmuf9z

hfwmuf9z1#

我只是跑 ping google.com 并使用这部分返回 [000:0000:0000:000::0000] 运行 pip --proxy=[000:0000:0000:000::0000] install pipreqs 而且它有效!
我将实际代理号码替换为[000:0000:0000:000::0000],在您的电脑中,您必须使用您的号码=)

相关问题