Search code examples
pythondjango

Python pip raising NewConnectionError while installing django-braces


I am getting the following error when I tried to install django-braces:

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 0x00000168673EC2E0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /packages/6d/ce/accaea120b323e62cb3bf8cce26892cdbfbf6b86d1b220fa2432b9b86acb/django_braces-1.14.0-py2.py3-none-any.whl

I can install any other libraries without any problem.

Questions:

  • Is there any problem with django-braces ?
  • If so, can you recommend an alternative to braces.SelectRelatedMixin ?

Versions:

  • python 3.9.2
  • django 3.1.7

Solution

  • https://github.com/pypa/pip/issues/4723#issuecomment-513512569

    tl;dr

    This message indicates that the DNS lookup likely failed. This can happen for a number of reasons, for example:

    1. Trying to access PyPI from a corporate network that blocks access

    2. Network connectivity issues

    1. A configured index-url in one of your configuration files is pointing to a location that is not accessible. See here for a command that can help troubleshoot this situation.