1
resposta

Erro ao instalar o psycopg2 e o psycopg2-binary

(venv) PS C:\Users\luis.ramos\Desktop\aplicação> pip install psycopg2 Collecting psycopg2 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip.vendor.urllib3.connection.HTTPSConnection object at 0x000002551F9700A0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /packages/39/c7/34b02adbcae31de7cc1540f93cf9d795833d87546ca937afd7dfc94f2579/psycopg2-2.9.2-cp39-cp39-winamd64.whl WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip.vendor.urllib3.connection.HTTPSConnection object at 0x000002551F9702B0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /packages/39/c7/34b02adbcae31de7cc1540f93cf9d795833d87546ca937afd7dfc94f2579/psycopg2-2.9.2-cp39-cp39-winamd64.whl WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip.vendor.urllib3.connection.HTTPSConnection object at 0x000002551F9704C0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /packages/39/c7/34b02adbcae31de7cc1540f93cf9d795833d87546ca937afd7dfc94f2579/psycopg2-2.9.2-cp39-cp39-winamd64.whl WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip.vendor.urllib3.connection.HTTPSConnection object at 0x000002551F9706D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /packages/39/c7/34b02adbcae31de7cc1540f93cf9d795833d87546ca937afd7dfc94f2579/psycopg2-2.9.2-cp39-cp39-winamd64.whl WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip.vendor.urllib3.connection.HTTPSConnection object at 0x000002551F9708E0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /packages/39/c7/34b02adbcae31de7cc1540f93cf9d795833d87546ca937afd7dfc94f2579/psycopg2-2.9.2-cp39-cp39-winamd64.whlERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/39/c7/34b02adbcae31de7cc1540f93cf9d795833d87546ca937afd7dfc94f2579/psycopg2-2.9.2-cp39-cp39-win_amd64.whl (Caused by NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002551F970AF0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

1 resposta

Oi Luiz, parece ser um erro de conexão. Outras bibliotecas estão sendo instaladas normalmente? Já verificou se o seu editor não foi bloqueado pelo firewall? De qualquer forma, outra opção é baixar a biblioteca na documentação e fazer a instalação manual, caso esteja utilizando o PyCharm é possível instalar pela interface da IDE.