26

I'm trying to install jupyterthemes package and getting this error.

enter image description here

Collecting jupyterthemes
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl
Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl (Caused by ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)))
WhatsThePoint
  • 3,395
  • 8
  • 31
  • 53
Yash
  • 319
  • 1
  • 4
  • 6

6 Answers6

29

It looks like you'd need to add trusted hosts.

Check this GitHub thread out.

Something like:

sudo pip install --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --upgrade --proxy=127.0.0.1:3128 jupyterthemes
VnC
  • 1,936
  • 16
  • 26
  • I could not use this command to install because I got the error "Proxy URL had no scheme, should start with http:// or https://". Instead to get it to work I used the command without the proxy argument: ``pip3 install --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org geopy`` – Noah Friedman Nov 27 '22 at 04:12
  • Used all the --trusted-host=host.com wihtout the proxy part and solved it – gzcarlosrd Aug 02 '23 at 21:01
6

please check if date is set correctly. this error pops up usually when the time and date are different from that of the server.

  • I approve, this has failed like this to me just after midnight, when my local time is not sync with UTC because of timezone difference – tiborka Nov 14 '22 at 08:05
2

You may have a security software installed. Zscaler is usually the culprit in my case, but other security softwares may cause this error to be thrown. VnC's answer is usually a quick fix. See a permanent fix explained.

In summary you will need to create a configuration file pip.ini or pip.conf in Unix. You will need to include trusted hosts in the file like below:

# for system-wide configuration file
[global]
trusted-host = pypi.python.org
               pypi.org
               raw.githubusercontent.com
               files.pythonhosted.org
# per-user configuration file
[user]
trusted-host = pypi.python.org
               pypi.org
               raw.githubusercontent.com
               files.pythonhosted.org
# per-virtualenv configuration file
[site]
trusted-host = pypi.python.org
               pypi.org
               raw.githubusercontent.com
               files.pythonhosted.org

I'm on Windows OS. Refer to the documentation for your OS.

Banty
  • 532
  • 6
  • 10
1

Try setting proxy

set http_proxy=http://proxy.myproxy.com
set https_proxy=https://proxy.myproxy.com
python get-pip.py
1

For me it happen due network firewall settings, try to connect to any other network and run the command. It worked for me.

0

I think some packages need to be installed using administrator privileges on mac try this:

sudo pip install

on window:

you have to open cmd by running it as administrator. I mean right click on cmd, choose

run as administrator then pip install pkg name

Hakim Asa
  • 443
  • 3
  • 15