在Mac OS Mojave上使用pip / pip3时出现回溯错误

时间:2018-12-13 18:44:18

标签: python python-3.x python-2.7 pip

我正在尝试使用pip / pip3来安装软件包,但我总是遇到相同的错误:

Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 318, in run
    resolver.resolve(requirement_set)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/resolve.py", line 256, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
    self.require_hashes
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 218, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 164, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/index.py", line 572, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/index.py", line 530, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/index.py", line 675, in _get_pages
    page = self._get_page(location)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/index.py", line 793, in _get_page
    return _get_html_page(link, session=self.session)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/index.py", line 144, in _get_html_page
    "Cache-Control": "max-age=0",
  File "/usr/local/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 525, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 396, 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 503, in request
    prep.url, proxies, stream, verify, cert
  File "/usr/local/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 676, in merge_environment_settings
    env_proxies = get_environ_proxies(url, no_proxy=no_proxy)
  File "/usr/local/lib/python3.7/site-packages/pip/_vendor/requests/utils.py", line 760, in get_environ_proxies
    if should_bypass_proxies(url, no_proxy=no_proxy):
  File "/usr/local/lib/python3.7/site-packages/pip/_vendor/requests/utils.py", line 744, in should_bypass_proxies
    bypass = proxy_bypass(parsed.hostname)
  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 2610, in proxy_bypass
    return proxy_bypass_macosx_sysconf(host)
  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 2587, in proxy_bypass_macosx_sysconf
    return _proxy_bypass_macosx_sysconf(host, proxy_settings)
  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 2573, in _proxy_bypass_macosx_sysconf
    if (hostIP >> mask) == (base >> mask):
ValueError: negative shift count

我在Mac OS Mojave上使用Homebrew来管理我的软件包,并以此方式安装了Python @ 2(2.7)和Python(3.7)。

我知道默认情况下Mac OS中有一个内置的Python版本,但是即使删除了现成的Python程序包,我仍然收到错误消息。

我尝试了easy_install,这是python.org和homebrew的官方下载程序,始终带有相同的错误消息。

对问题可能有什么想法?

0 个答案:

没有答案