It is sometimes because of connectivity issue. Re-running the same command when connectivity is okay solves it.
pip install virtualenv
Initial Output:
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 0x0000023A91A94190>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
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 0x0000023A922B3390>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
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 0x0000023A922B0850>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
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 0x0000023A922C5990>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
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 0x0000023A922C64D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/virtualenv/
ERROR: Could not find a version that satisfies the requirement virtualenv (from versions: none)
ERROR: No matching distribution found for virtualenv
WARNING: There was an error checking the latest version of pip.
Output after re-run when connectivity is okay:
Collecting virtualenv
Using cached virtualenv-20.17.0-py3-none-any.whl (8.8 MB)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/distlib/
Collecting distlib<1,>=0.3.6
Using cached distlib-0.3.6-py2.py3-none-any.whl (468 kB)
Collecting filelock<4,>=3.4.1
Using cached filelock-3.8.0-py3-none-any.whl (10 kB)
Collecting platformdirs<3,>=2.4
Using cached platformdirs-2.5.4-py3-none-any.whl (14 kB)
Installing collected packages: distlib, platformdirs, filelock, virtualenv
Successfully installed distlib-0.3.6 filelock-3.8.0 platformdirs-2.5.4 virtualenv-20.17.0
[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip