nosetests pip install error on python 3.4 in a virtualenv

317 views Asked by At

Upgrading app from python 2.7 to 3.4 and nose is generating the following error:

Collecting nose==1.3.4 (from -r requirements/dev.txt (line 9))
  Exception:
  Traceback (most recent call last):
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/basecommand.py", line 215, in main
      status = self.run(options, args)
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/commands/install.py", line 339, in run
      requirement_set.prepare_files(finder)
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/req/req_set.py", line 333, in prepare_files
      upgrade=self.upgrade,
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/index.py", line 305, in find_requirement
      page = self._get_page(main_index_url, req)
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/index.py", line 795, in _get_page
      return HTMLPage.get_page(link, req, session=self.session)
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/index.py", line 884, in get_page
      "Cache-Control": "max-age=600",
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py", line 473, in get
      return self.request('GET', url, **kwargs)
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/download.py", line 332, in request
      return super(PipSession, self).request(method, url, *args, **kwargs)
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py", line 461, in request
      resp = self.send(prep, **send_kwargs)
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py", line 573, in send
      r = adapter.send(request, **kwargs)
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/cachecontrol/adapter.py", line 36, in send
      cached_response = self.controller.cached_request(request)
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/cachecontrol/controller.py", line 100, in cached_request
      resp = self.serializer.loads(request, self.cache.get(cache_url))
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/cachecontrol/serialize.py", line 62, in loads
      return getattr(self, "_loads_v{0}".format(ver))(request, data)
    File "/Users/me/.virtualenvs/python3.4/lib/python3.4/site-packages/pip/_vendor/cachecontrol/serialize.py", line 91, in _loads_v1
      body = io.BytesIO(cached["response"].pop("body"))
  TypeError: 'str' does not support the buffer interface

Running: OSX 10.10, brew, python 3.4, virtualenv and virtualenvwrapper

mkvirtualenv python3.4 --python=/usr/local/bin/python3

Works fine on python 2.7

1

There are 1 answers

0
miindlek On BEST ANSWER

You have to update the pip installation of your virtual environment to solve this problem.