Fixing Pip Timeout Problems

For a large package like tensorflow I was experiencing the following error in pip

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

I noticed the pip has a timeout parameter that can be set:

pip --default-timeout=1000 install package-name