问题描述
我无法在Ubuntu 15.10上为pypy 4.0.1安装pip.
I cannot install pip for pypy 4.0.1 on Ubuntu 15.10.
我从 http://pypy.org/download.html 下载了pypy 4.0.1.为此创建了一个符号链接.并使用wget从 https://bootstrap.pypa.io/get-下载get-pip.py. pip.py .
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.
但是当我运行sudo pypy 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
我可以毫无问题地运行sudo python get-pip.py
,但使用pypy失败.我也尝试过Ubuntu 12.04和14.04,但是没有运气.
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.
我已经安装了Python 2.7.10,并且正在使用Linode机器.但是改用DigitalOcean并没有帮助.
I have Python 2.7.10 installed and I'm using a Linode machine. But changed to a DigitalOcean one didn't help.
推荐答案
如何从Ubuntu档案sudo apt install pypy
安装PyPy.或者,如果您需要最新版本,请从 PyPy PPA
How about installing PyPy from the Ubuntu archives sudo apt install pypy
. Or if you want the latest version, from the PyPy PPA
然后,如果您创建一个virtualenv,它将在其中包含pip:
Then if you create a virtualenv, it will have pip inside it:
$ sudo apt-get install virtualenv
$ virtualenv -p pypy ve
$ . ve/bin/activate
$ pip install ...
这篇关于无法在Ubuntu上为pypy安装pip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!