Subscribed unsubscribe Subscribe Subscribe

ふり返る暇なんて無いね

日々のメモ書きをつらつらと

pyenvで入れたpythonでUnicodeEncodeErrorと怒られる

python

easy_installだとちゃんとインストールできる。なんで?

Ubuntu 12.04の環境です。

% pip install fabric
Collecting fabric
Exception:
Traceback (most recent call last):
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
    status = self.run(options, args)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/commands/install.py", line 294, in run
    requirement_set.prepare_files(finder)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/req/req_set.py", line 334, in prepare_files
    functools.partial(self._prepare_file, finder))
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/req/req_set.py", line 321, in _walk_req_to_install
    more_reqs = handler(req_to_install)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/req/req_set.py", line 461, in _prepare_file
    req_to_install.populate_link(finder, self.upgrade)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/req/req_install.py", line 250, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/index.py", line 486, in find_requirement
    all_versions = self._find_all_versions(req.name)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/index.py", line 404, in _find_all_versions
    index_locations = self._get_index_urls_locations(project_name)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/index.py", line 378, in _get_index_urls_locations
    page = self._get_page(main_index_url)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/index.py", line 818, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/index.py", line 928, in get_page
    "Cache-Control": "max-age=600",
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 477, in get
    return self.request('GET', url, **kwargs)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/download.py", line 373, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py", line 36, in send
    cached_response = self.controller.cached_request(request)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py", line 102, in cached_request
    resp = self.serializer.loads(request, self.cache.get(cache_url))
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 108, in loads
    return getattr(self, "_loads_v{0}".format(ver))(request, data)
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 170, in _loads_v2
    cached["response"]["body"]
  File "/home/masasuzu/.anyenv/envs/pyenv/versions/2.7.10/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 20, in _b64_decode_bytes
    return base64.b64decode(b.encode("ascii"))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-4452: ordinal not in range(128)