尝试使用pip时出现许多错误

时间:2018-07-05 13:32:41

标签: python pip

当尝试点子安装任何软件包时(具体来说,现在是gspread)... 我收到的完整消息是:

    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)

我正在高塞拉山脉

哪个pip = / usr / local / bin / pip

python = 2.7.1

我还是python的新手,这是我第一次在此机器上使用它。我用谷歌搜索了这个问题的许多不同形式,无法弄清楚我在做什么错。

很抱歉遇到这样一个简单的问题,但我们将不胜感激。谢谢

0 个答案:

没有答案