Atualizando o setuptools pip

0

A maneira como instalei o pip3 é assim:

sudo apt-get install python3-pip

Embora isso funcionasse bem quando eu quis atualizar o setuptools do pip usando o seguinte comando, ele gerou uma exceção.

Eu tentei atualizar o setuptools pip usando o seguinte comando:

sudo pip3 install --upgrade pip setuptools

Mas isso gerou uma exceção de python, algo relacionado ao arquivo connection.py, etc.

A mensagem de erro é esta:

Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-
any.whl/urllib3/connection.py", line 137, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)

File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-
any.whl/urllib3/util/connection.py", line 67, in create_connection
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):

File "/usr/lib/python3.5/socket.py", line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:
Traceback (most recent call last):

File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-
any.whl/urllib3/connectionpool.py", line 560, in urlopen
body=body, headers=headers)

File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-
any.whl/urllib3/connectionpool.py", line 346, in _make_request
self._validate_conn(conn)

File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-
any.whl/urllib3/connectionpool.py", line 787, in _validate_conn
conn.connect()

File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-
any.whl/urllib3/connection.py", line 217, in connect
conn = self._new_conn()

File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-
any.whl/urllib3/connection.py", line 146, in _new_conn
self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError:
<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at
0x7f2c30b6f2e8>: Failed to establish a new connection: [Errno -3]

Temporary failure in name resolution
During handling of the above exception, another exception occurred:

Traceback (most recent call last):File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 209, in
main
status = self.run(options, args)

File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 317,
in run
requirement_set.prepare_files(finder)

File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 360, in
prepare_files
ignore_dependencies=self.ignore_dependencies))

File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 448, in
_prepare_file
req_to_install, finder)

File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 397, in
_check_skip_installed
finder.find_requirement(req_to_install, self.upgrade)

File "/usr/lib/python3/dist-packages/pip/index.py", line 442, in
find_requirement
all_candidates = self.find_all_candidates(req.name)

File "/usr/lib/python3/dist-packages/pip/index.py", line 400, in
find_all_candidates
for page in self._get_pages(url_locations, project_name):

File "/usr/lib/python3/dist-packages/pip/index.py", line 545, in
_get_pages
page = self._get_page(location)

File "/usr/lib/python3/dist-packages/pip/index.py", line 648, in _get_page
return HTMLPage.get_page(link, session=self.session)

File "/usr/lib/python3/dist-packages/pip/index.py", line 757, in get_page
"Cache-Control": "max-age=600",

File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-
any.whl/requests/sessions.py", line 480, in get
return self.request('GET', url, **kwargs)

File "/usr/lib/python3/dist-packages/pip/download.py", line 378, in
request
return super(PipSession, self).request(method, url, *args, **kwargs)

File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-
any.whl/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)

File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-
any.whl/requests/sessions.py", line 576, in sendr = adapter.send(request, **kwargs)

File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-
any.whl/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)

File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-
any.whl/requests/adapters.py", line 376, in send
timeout=timeout

File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-
any.whl/urllib3/connectionpool.py", line 610, in urlopen
_stacktrace=sys.exc_info()[2])

File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-
any.whl/urllib3/util/retry.py", line 228, in increment
total -= 1

TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
vasista@vasista-OptiPlex-9020:~$

Por favor, sugira outra maneira de atualizar o setuptools pip ou qualquer outra maneira de resolver este problema

    
por Vasista 21.03.2018 / 15:40

0 respostas