在linux上安装pip时出错

时间:2017-10-22 00:18:03

标签: python linux

我在Raspberry Pi上运行Raspbian Linux,我安装了pythonpython3pip。当我运行sudo pip install pillow时,我得到了非常大的代码输出。第一个错误是Failed building wheel for pillow,之后说它无法制作枕头并安装枕头。

在代码的最后,我有这个错误的红色:

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Yhx8TM/pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.rea                                                                          
d().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-yjhZ83-record/install-record.txt --single-version-externally-m                                                                          
anaged --compile" failed with error code 1 in /tmp/pip-build-Yhx8TM/pillow/

我一直在关注https://pillow.readthedocs.io/en/latest/installation.html的安装说明,但在那里找不到解决方案。

我还没有在网上找到任何类似的错误。

更新:我尝试安装cython,更新gcc和g ++。我也尝试过运行python -m pip install pillow。我试过通过pip安装django,我得到这个错误:

Exception:
Traceback (most recent call last):
  File "/home/pi/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/pi/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/home/pi/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/home/pi/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/home/pi/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/home/pi/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/home/pi/.local/lib/python2.7/site-packages/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "/home/pi/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pytz'

更新:我已经为python3安装了pip3,我遇到了与之前相同的问题。

0 个答案:

没有答案