New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After installing python 3.x on Mac pip doesn't work at all #85643
Comments
Using pip fails with the same error messages independent of version an user. Also su or sudo -H doesn't change anything: After a quite long search I found that it is a problem with the proxy config. You need to remove all settings in network settings/proxy even those defining which domains shouldn't use a proxy. Proxy settings work fine with everything except python. xcode-select install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install pyenv
pyenv install 3.7.3
pip list --outdated or pip install something
Exception
xxx-MBP:~ xxx$ pip list --outdated
Exception:
Traceback (most recent call last):
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 179, in main
status = self.run(options, args)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 144, in run
packages = self.get_outdated(packages, options)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 152, in get_outdated
dist for dist in self.iter_packages_latest_infos(packages, options)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 152, in <listcomp>
dist for dist in self.iter_packages_latest_infos(packages, options)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 179, in iter_packages_latest_infos
all_candidates = finder.find_all_candidates(dist.key)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/index.py", line 610, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/index.py", line 743, in _get_pages
page = _get_html_page(location, session=self.session)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/index.py", line 229, in _get_html_page
resp = _get_html_response(url, session=session)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/index.py", line 177, in _get_html_response
"Cache-Control": "max-age=0",
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/download.py", line 403, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 524, in request
prep.url, proxies, stream, verify, cert
File "/Users/xxxx.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 700, in merge_environment_settings
env_proxies = get_environ_proxies(url, no_proxy=no_proxy)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_vendor/requests/utils.py", line 761, in get_environ_proxies
if should_bypass_proxies(url, no_proxy=no_proxy):
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_vendor/requests/utils.py", line 745, in should_bypass_proxies
bypass = proxy_bypass(parsed.hostname)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/urllib/request.py", line 2610, in proxy_bypass
return proxy_bypass_macosx_sysconf(host)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/urllib/request.py", line 2587, in proxy_bypass_macosx_sysconf
return _proxy_bypass_macosx_sysconf(host, proxy_settings)
File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/urllib/request.py", line 2573, in _proxy_bypass_macosx_sysconf
if (hostIP >> mask) == (base >> mask):
ValueError: negative shift count |
I don't quite understand what the issue is.
|
The error is due to invalid proxy settings on the system. I can reproduce the error by enabling a HTTP proxy in system settings, while adding "172.19.0.0/40" to the proxy exclude list in the HTTP proxy settings. |
I've tested the same settings with Safari, and that browser ignores excludes with an invalid prefix length. I've created a PR that does the same for urllib.request. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: