} ..." > /proc/sys/net/ipv6/conf/all/disable_ipv6'" >

PIP: 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Created:

This error was found on the MEO router while trying to install kivy:

pip install kivy -v

Scroll down for the solution!

The Outputs error is the next one:

Created temporary directory: /tmp/pip-ephem-wheel-cache-rs27mmeh
Created temporary directory: /tmp/pip-install-dtnthpzj
Collecting kivy
  1 location(s) to search for versions of kivy:
  * https://pypi.python.org/simple/kivy/
  Getting page https://pypi.python.org/simple/kivy/
  Looking up "https://pypi.python.org/simple/kivy/" in the cache
  Returning cached "301 Moved Permanently" response (ignoring date and etag information)
  Looking up "https://pypi.org/simple/kivy/" in the cache
  No cache entry available
  Starting new HTTPS connection (1): pypi.org
  Incremented Retry for (url='/simple/kivy/'): Retry(total=4, connect=None, read=None, redirect=None, status=None)
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/kivy/
  Starting new HTTPS connection (2): pypi.org
  Incremented Retry for (url='/simple/kivy/'): Retry(total=3, connect=None, read=None, redirect=None, status=None)
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/kivy/
  Starting new HTTPS connection (3): pypi.org
  Incremented Retry for (url='/simple/kivy/'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/kivy/
  Starting new HTTPS connection (4): pypi.org
  Incremented Retry for (url='/simple/kivy/'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/kivy/
  Starting new HTTPS connection (5): pypi.org
  Incremented Retry for (url='/simple/kivy/'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/kivy/
  Starting new HTTPS connection (6): pypi.org
  Could not fetch URL https://pypi.python.org/simple/kivy/: connection error: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/kivy/ (Caused by ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))) - skipping
  Could not find a version that satisfies the requirement kivy (from versions: )
Cleaning up...
No matching distribution found for kivy
Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/commands/install.py", line 291, in run
    resolver.resolve(requirement_set)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/resolve.py", line 103, in resolve
    self._resolve_one(requirement_set, req)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/resolve.py", line 257, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/resolve.py", line 210, in _get_abstract_dist_for
    self.require_hashes
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/operations/prepare.py", line 243, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/req/req_install.py", line 307, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/index.py", line 533, in find_requirement
    'No matching distribution found for %s' % req
pip._internal.exceptions.DistributionNotFound: No matching distribution found for kivy
You are using pip version 10.0.0, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Solution

We found that the solution is to disable ipv6 temporary with the command:

sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6'