Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to install pip for pypy on Ubuntu

I cannot install pip for pypy 4.0.1 on Ubuntu 15.10.

I downloaded pypy 4.0.1 from http://pypy.org/download.html. Created a symlink for it. And used wget to download get-pip.py from https://bootstrap.pypa.io/get-pip.py.

But when I ran sudo pypy get-pip.py, I got exception:

Collecting pip
Exception:
Traceback (most recent call last):
    File "/tmp/tmps2kjCI/pip.zip/pip/basecommand.py", line 211, in main
      status = self.run(options, args)
    File "/tmp/tmps2kjCI/pip.zip/pip/commands/install.py", line 294, in run
      requirement_set.prepare_files(finder)
    File "/tmp/tmps2kjCI/pip.zip/pip/req/req_set.py", line 334, in prepare_files
      functools.partial(self._prepare_file, finder))
    File "/tmp/tmps2kjCI/pip.zip/pip/req/req_set.py", line 321, in _walk_req_to_install
      more_reqs = handler(req_to_install)
    File "/opt/pypy-4.0.1-linux64/lib_pypy/_functools.py", line 42, in __call__
      return self._func(*(self._args + fargs), **fkeywords)
    File "/tmp/tmps2kjCI/pip.zip/pip/req/req_set.py", line 491, in _prepare_file
      session=self.session)
    File "/tmp/tmps2kjCI/pip.zip/pip/download.py", line 825, in unpack_url
      session,
    File "/tmp/tmps2kjCI/pip.zip/pip/download.py", line 673, in unpack_http_url
      from_path, content_type = _download_http_url(link, session, temp_dir)
    File "/tmp/tmps2kjCI/pip.zip/pip/download.py", line 885, in _download_http_url
      with open(file_path, 'wb') as content_file:
    TypeError: expected string, got NoneType object

I could run sudo python get-pip.py without problem but failed with pypy. I also tried Ubuntu 12.04 and 14.04 but no luck.

I have Python 2.7.10 installed and I'm using a Linode machine. But changed to a DigitalOcean one didn't help.

like image 460
jerry.z Avatar asked Nov 09 '22 22:11

jerry.z


1 Answers

How about installing PyPy from the Ubuntu archives sudo apt install pypy. Or if you want the latest version, from the PyPy PPA

Then if you create a virtualenv, it will have pip inside it:

$ sudo apt-get install virtualenv
$ virtualenv -p pypy ve
$ source ./ve/bin/activate
$ pip install ...
like image 130
tumbleweed Avatar answered Nov 11 '22 12:11

tumbleweed