I am installing django in ubuntu using the command pip install django==1.11.2 but i am getting the following error
Collecting django==1.11.2
Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 555, in urlopen
self._prepare_proxy(conn)
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 753, in _prepare_proxy
conn.connect()
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connection.py", line 230, in connect
self._tunnel()
File "/usr/lib/python3.5/http/client.py", line 832, in _tunnel
message.strip()))
OSError: Tunnel connection failed: 407 Proxy Authentication Required
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 328, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 748, in build
self.requirement_set.prepare_files(self.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 512, in _prepare_file
finder, self.upgrade, require_hashes)
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 273, in populate_link
self.link = finder.find_requirement(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 send
r = adapter.send(request, **kwargs)
.
.
.
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'
i have also tried sudo -H pip install django==1.11.2 still the same error
Seems like the issue is with your internet connection. I believe you are under proxy. You need to set the proxy.
Related
When I am trying to install something with pip on a brand new flashed SD card, it always fails. I know this has been posted before but I still haven't found an answer that has fixed it. I am defiantly not behind any kind of proxy. I have tried disabling ipv6. What else should I do?
Here is an example:
Exception:
Traceback (most recent call last):
File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
chunked=chunked)
File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 391, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 387, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/srv/homeassistant/lib/python3.5/site-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/srv/homeassistant/lib/python3.5/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "/srv/homeassistant/lib/python3.5/site-packages/pip/download.py", line 821, in unpack_url
hashes=hashes
File "/srv/homeassistant/lib/python3.5/site-packages/pip/download.py", line 659, in unpack_http_url
hashes)
File "/srv/homeassistant/lib/python3.5/site-packages/pip/download.py", line 853, in _download_http_url
stream=True,
File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/srv/homeassistant/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
When I run pip install matplotlib or pip3 install matplotlib from my terminal, I get the following error. Can someone tell me why this is happening? I use ubuntu 16.04. Thanks in advance.
Collecting matplotlib
Exception:
Traceback (most recent call last):
File "/home/surya/.local/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/surya/.local/lib/python3.5/site-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/home/surya/.local/lib/python3.5/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/home/surya/.local/lib/python3.5/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/home/surya/.local/lib/python3.5/site-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/home/surya/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/home/surya/.local/lib/python3.5/site-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/home/surya/.local/lib/python3.5/site-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/home/surya/.local/lib/python3.5/site-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/home/surya/.local/lib/python3.5/site-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/home/surya/.local/lib/python3.5/site-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/home/surya/.local/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 488, in get
return self.request('GET', url, **kwargs)
File "/home/surya/.local/lib/python3.5/site-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/home/surya/.local/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/home/surya/.local/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/home/surya/.local/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/home/surya/.local/lib/python3.5/site-packages/pip/_vendor/requests/adapters.py", line 390, in send
conn = self.get_connection(request.url, proxies)
File "/home/surya/.local/lib/python3.5/site-packages/pip/_vendor/requests/adapters.py", line 290, in get_connection
proxy_manager = self.proxy_manager_for(proxy)
File "/home/surya/.local/lib/python3.5/site-packages/pip/_vendor/requests/adapters.py", line 184, in proxy_manager_for
**proxy_kwargs
File "/home/surya/.local/lib/python3.5/site-packages/pip/_vendor/requests/adapters.py", line 43, in SOCKSProxyManager
raise InvalidSchema("Missing dependencies for SOCKS support.")
pip._vendor.requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support.
When trying to pip install any package (specifically, right now, gspread)...
Full message I get is:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 305, in run
wb.build(autobuilding=True)
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 705, in build
self.requirement_set.prepare_files(self.finder)
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 409, in _prepare_file
req_to_install, finder)
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 365, in _check_skip_installed
finder.find_requirement(req_to_install, self.upgrade)
File "/Library/Python/2.7/site-packages/pip/index.py", line 486, in find_requirement
all_versions = self._find_all_versions(req.name)
File "/Library/Python/2.7/site-packages/pip/index.py", line 404, in _find_all_versions
index_locations = self._get_index_urls_locations(project_name)
File "/Library/Python/2.7/site-packages/pip/index.py", line 378, in _get_index_urls_locations
page = self._get_page(main_index_url)
File "/Library/Python/2.7/site-packages/pip/index.py", line 818, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/Library/Python/2.7/site-packages/pip/index.py", line 928, in get_page
"Cache-Control": "max-age=600",
File "/Library/Python/2.7/site-packages/pip/_vendor/requests/sessions.py", line 477, in get
return self.request('GET', url, **kwargs)
File "/Library/Python/2.7/site-packages/pip/download.py", line 373, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip/_vendor/requests/sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Python/2.7/site-packages/pip/_vendor/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/Library/Python/2.7/site-packages/pip/_vendor/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/Library/Python/2.7/site-packages/pip/_vendor/requests/adapters.py", line 370, in send
timeout=timeout
File "/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
body=body, headers=headers)
File "/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 344, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
File "/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 314, in _raise_timeout
if 'timed out' in str(err) or 'did not complete (read)' in str(err): # Python 2.6
TypeError: __str__ returned non-string (type Error)
I am running high sierra,
which pip = /usr/local/bin/pip
python = 2.7.1
I am still new to python and this is my first time using it on this machine. I have googled a lot of different variations of this problem and am unable to figure out what I am doing wrong.
Sorry for such a simple question but any help would be appreciated. Thanks
I am trying to install packages from inside the virtualenv
(Ubuntu 14.04LTS)
pip install scipy
I end up with the following error:
Collecting scipy
Exception:
Traceback (most recent call last):
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/commands/install.py", line 324, in run
requirement_set.prepare_files(finder)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 488, in get
return self.request('GET', url, **kwargs)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 390, in send
conn = self.get_connection(request.url, proxies)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 290, in get_connection
proxy_manager = self.proxy_manager_for(proxy)
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 184, in proxy_manager_for
**proxy_kwargs
File "/home/rduser/venvs/python2713/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.py", line 154, in __init__
"Unable to determine SOCKS version from %s" % proxy_url
ValueError: Unable to determine SOCKS version from socks://10.0.0.28:8080/
How do I get past this.?
P.S: I am using the latest version of pip
For some reason I can't use pip to install or update python packages in my system.
I get this error.
Exception:
Traceback (most recent call last):
File
"/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/basecommand.py",
line 209, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/commands/install.py",
line 299, in run
requirement_set.prepare_files(finder)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_set.py",
line 360, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_set.py",
line 448, in _prepare_file
req_to_install, finder)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_set.py",
line 397, in _check_skip_installed
finder.find_requirement(req_to_install, self.upgrade)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/index.py",
line 440, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/index.py",
line 398, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/index.py",
line 543, in _get_pages
page = self._get_page(location)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/index.py",
line 646, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/index.py",
line 755, in get_page
"Cache-Control": "max-age=600",
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/sessions.py",
line 480, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/download.py",
line 378, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/sessions.py",
line 468, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/sessions.py",
line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/cachecontrol/adapter.py",
line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/adapters.py",
line 376, in send
timeout=timeout
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/connectionpool.py",
line 559, in urlopen
body=body, headers=headers)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/connectionpool.py",
line 345, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/connectionpool.py",
line 784, in _validate_conn
conn.connect()
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/connection.py", line 252, in connect
ssl_version=resolved_ssl_version)
File "/usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py",
line 296, in ssl_wrap_socket
cnx.set_tlsext_host_name(server_hostname)
File "build/bdist.linux-x86_64/egg/OpenSSL/SSL.py", line 423, in explode
raise NotImplementedError(error) NotImplementedError: SNI not available
I tried installing the packages pyOpenSSL, ndg-httpsclient and pyasn1 manually but still the problem persists.
My system is a RED HAT 4.1.2(server) with Python 2.7.3
Thanks in advance
You OpenSSL(not pyOpenSSL) is too old, you need to install an OpenSSL version that supports SNI.