Uninstalled and installed python and now facing issues with pip - python

I use a mac and I switched from python2 to python3 recently. Post doing that I couldn't install jupyter on my laptop due to some dependency issues. After a lot of trial and errors, I just uninstalled Python 3 and installed it with brew instead.
I used the following guides to uninstall 1, 2.
Post that I installed jupyter again and now I'm facing this issue:
$ pip install --index-url '..' --trusted-host '..' jupyter
This is how I usually install packages on my laptop behind a firewall and it works. But now I'm getting the following exception:
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
status = self.run(options, args)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 382, in run
resolver.resolve(requirement_set)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
self._resolve_one(requirement_set, req)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 311, in _get_abstract_dist_for
req.populate_link(self.finder, upgrade_allowed, self.require_hashes)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 225, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/index.py", line 879, in find_requirement
req.name, specifier=req.specifier, hashes=hashes,
File "/usr/local/lib/python3.7/site-packages/pip/_internal/index.py", line 861, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/index.py", line 791, in find_all_candidates
collected_links = self._link_collector.collect_links(project_name)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/collector.py", line 541, in collect_links
for page in self._get_pages(url_locations):
File "/usr/local/lib/python3.7/site-packages/pip/_internal/collector.py", line 493, in _get_pages
page = _get_html_page(location, session=self.session)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/collector.py", line 339, in _get_html_page
resp = _get_html_response(url, session=session)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/collector.py", line 146, in _get_html_response
"Cache-Control": "max-age=0",
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/network/session.py", line 426, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/requests/adapters.py", line 412, in send
conn = self.get_connection(request.url, proxies)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/requests/adapters.py", line 309, in get_connection
proxy_manager = self.proxy_manager_for(proxy)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/requests/adapters.py", line 199, in proxy_manager_for
**proxy_kwargs)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/poolmanager.py", line 470, in proxy_from_url
return ProxyManager(proxy_url=url, **kw)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/poolmanager.py", line 420, in __init__
raise ProxySchemeUnknown(proxy.scheme)
pip._vendor.urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme None
I have set the proxy and it can be seen using env. I've also tried:
export http_proxy="http://<hostname>:<port>"
export https_proxy="https://<hostname>:<port>"
Nothing seems to be working.
Any suggestions would be helpful.

In the end, what helped was unset https_proxy http_proxy.

Related

Error when installing any package in python

since I wanted to install pyserial, I always get these Errormessages when installing any package with pip-installer. I checked every similar case on Stackoverflow and other Hubs, but nothing of their solutions worked for me. Anyway, i want to install python2.7 Addons on a Debian Linux (Embedded System) by using a proxy.
Thank you for your help in advance.
Best regards
marco_stdgl
# pip install pyserial
Collecting pyserial
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/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 "/usr/lib/python2.7/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/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 "/usr/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 "/usr/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 "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/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 "/usr/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'
See https://github.com/urllib3/urllib3/issues/1486
https://github.com/pypa/pip/issues/4779 and https://answers.launchpad.net/ubuntu/+question/659285
If reinstalling pip doesn't fix your issue, look if you can update your Debian distro. They are using a modified pip which is causing the issue.
It looks like reinstalling pip should fix your issue. Since you're on an Linux machine, just run these commands:
apt-get remove python-pip
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
Reinstall or Modify Your pip.

TypeError: not expecting type '<type 'bytes'>' on ironpython package install

I'm trying to install some packages for IronPython 2.7 using this command:
>C:\Program Files\IronPython 2.7\> ipy -X:Frames -m pip install (PackageName)
And I keep getting these blocks of error messages.
>ERROR: Exception:
Traceback (most recent call last):
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\cli\base_command.py", line 188, in _main
status = self.run(options, args)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\cli\req_command.py", line 185, in wrapper
return func(self, options, args)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\commands\install.py", line 332, in run
requirement_set = resolver.resolve(
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 179, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 362, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 305, in _get_abstract_dist_for
skip_reason = self._check_skip_installed(req)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 250, in _check_skip_installed
self.finder.find_requirement(req_to_install, upgrade=True)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index\package_finder.py", line 900, in find_requirement
best_candidate_result = self.find_best_candidate(
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index\package_finder.py", line 883, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index\package_finder.py", line 827, in find_all_candidates
package_links = self.process_project_url(
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index\package_finder.py", line 792, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index\collector.py", line 612, in fetch_page
return _get_html_page(location, session=self.session)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index\collector.py", line 451, in _get_html_page
resp = _get_html_response(url, session=session)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index\collector.py", line 149, in _get_html_response
resp = session.get(
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\requests\sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\network\session.py", line 421, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\requests\sessions.py", line 516, in request
prep = self.prepare_request(req)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\requests\sessions.py", line 449, in prepare_request
p.prepare(
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\requests\models.py", line 314, in prepare
self.prepare_url(url, params)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\requests\models.py", line 380, in prepare_url
scheme, auth, host, port, path, query, fragment = parse_url(url)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\urllib3\util\url.py", line 381, in parse_url
host = _normalize_host(host, scheme)
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\urllib3\util\url.py", line 296, in _normalize_host
return six.ensure_str(
File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\urllib3\packages\six.py", line 951, in ensure_str
raise TypeError("not expecting type '%s'" % type(s))
TypeError: not expecting type '<type 'bytes'>'
I have no idea what any of this means. I'm totally stumped.
This is happening as I'm trying to pythonnet to IronPython for Visual Studio. Pip works fine for me on standard Python but this is only happening to me with IronPython.
What do they mean? What's wrong here? How do I fix this?
PS: This is happening on my Windows 10 laptop.
I solve this problem following this question:
Why does IronPython tell me that pip is a package and not an executable?
Probably you upgraded the IronPython pip as I did.
Remove anything regarding pip and setuptools in Lib/site-packages
Run ipy -X:Frames -m ensurepip
Now you should be able to install through pip.

Tensorflow with raspberry pi 2

I tried to install the tensorflow but I got an error message which is a memory error.
pip3 install --user --upgrade tensorflow
After I found a solution for that Link. I use sudo command additionally.
sudo pip3 install --no-cache-dir tensorflow
Tensorflow was installed successfully for python 3.5.3 in raspberry pi 2.
When I tried following command which is recommended in google installation guide it is not working.
python3 -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"
Error massage:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named 'tensorflow'
After that, I tried to import tensorfolw library in Thonny (import tensorflow as tf) but I got following error message.
/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: compiletime version 3.4 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.5
return f(*args, **kwds)
/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: builtins.type size changed, may indicate binary incompatibility. Expected 432, got 412
return f(*args, **kwds)
How to solve this error for raspberry pi?
Updated.
I tried to install again using sudo pip3 install --no-cache-dir tensorflow I got following error.
Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
chunked=chunked)
File "/usr/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 "/usr/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 258, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.5/socket.py", line 576, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.5/ssl.py", line 937, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.5/ssl.py", line 799, in read
return self._sslobj.read(len, buffer)
File "/usr/lib/python3.5/ssl.py", line 583, in read
v = self._sslobj.read(len, buffer)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 342, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/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 "/usr/lib/python3/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/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 "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 630, in send
history = [resp for resp in gen] if allow_redirects else []
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 630, in <listcomp>
history = [resp for resp in gen] if allow_redirects else []
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 190, in resolve_redirects
**adapter_kwargs
File "/usr/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 "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/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 "/usr/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'
Try
`sudo apt-get install libatlas-base-dev
pip3 install tensorflow`

Virtual environments issue on mac

I'm stuck on an issue with virtualenv and hoping someone may be able to help.
I see this error when trying to create a virtual env: OSError: Command /Users/andy.smith/foo/bar/bin/python2.7 - setuptools pip wheel failed with error code 2
I've tried clean up up my Python environment and reinstall python and virtualenv,
and tried fixes from similar questions but to no avail. Any help would is extremely welcome.
The full error is:
$ mkdir foo
$ cd foo
$ virtualenv bar
New python executable in /Users/andy.smith/foo/bar/bin/python2.7
Also creating executable in /Users/andy.smith/foo/bar/bin/python
Installing setuptools, pip, wheel...
Complete output from command /Users/andy.smith/foo/bar/bin/python2.7 - setuptools pip wheel:
Looking in links: /usr/local/lib/python2.7/site-packages, /usr/local/lib/python2.7/site-packages/virtualenv_support, /usr/local/lib/python2.7/site-packages/virtualenv_support
Collecting setuptools
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/basecommand.py", line 228, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/commands/install.py", line 291, in run
resolver.resolve(requirement_set)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/resolve.py", line 103, in resolve
self._resolve_one(requirement_set, req)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/resolve.py", line 257, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/resolve.py", line 210, in _get_abstract_dist_for
self.require_hashes
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/operations/prepare.py", line 245, in prepare_linked_requirement
req.populate_link(finder, upgrade_allowed, require_hashes)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/req/req_install.py", line 307, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 484, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 442, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 587, in _get_pages
page = self._get_page(location)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 705, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 814, in get_page
"Cache-Control": "max-age=600",
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_vendor/requests/sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/download.py", line 397, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_vendor/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_vendor/requests/sessions.py", line 625, in send
r = dispatch_hook('response', hooks, r, **kwargs)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_vendor/requests/hooks.py", line 31, in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/download.py", line 189, in handle_401
username = six.moves.input("User for %s: " % parsed.netloc)
EOFError: EOF when reading a line
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 712, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 947, in create_environment
download=download,
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 904, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 796, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/andy.smith/foo/bar/bin/python2.7 - setuptools pip wheel failed with error code 2
Thanks!

OSError: Tunnel connection failed: 407 Proxy Authentication Required

I am trying to install jupyter on my recently installed Ubuntu 16. So I tried:
$ sudo pip3 install jupyter
I get the following error:
The directory '/home/snehal/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/snehal/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting jupyter
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 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 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/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'
Searching didn't really help me. I also tried
export http_proxy="http://user:password#proxy:port"
But it still throws the same error. Does anybody have any idea of how to fix this? Thanks in advance.

Categories

Resources