【问题标题】:Can't install Python Imaging Library using pip无法使用 pip 安装 Python 映像库
【发布时间】:2013-12-16 23:16:34
【问题描述】:

尝试使用 PIP 安装 Python Imaging Library(PIL) 时,安装失败并出现以下错误:

SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 16, in <module>
File "/tmp/pip_build_root/pil/setup.py", line 182
print "--- using Tcl/Tk libraries at", TCL_ROOT

Somebody else 面临同样的问题,但提供的解决方案适用于不同的库,对我不起作用。在官方邮件列表中有一个旧条目 (2003) 讨论了该问题,但没有提供解决方案,而是要求降级 PIL 并稍后提供修复(我不想降级)。

此处提供了 pip.log 文件:http://pastebin.com/YeBLmMBm

【问题讨论】:

  • 据我所知,无法使用pip 安装PIL。这就是存在替代 Pillow 的原因。

标签: python pip


【解决方案1】:

PIL 有一个新的分支,称为 Pillow,对于很多人来说,它似乎比 PIL 更稳定。它也很容易安装。查看here(用于信息/文档)和here(用于安装)。虽然我认为pip install Pillow 应该可以工作

【讨论】:

  • 谢谢。我试图在 Django 中为 ImageField 安装 PIL,我找到了 Pillow here 的解决方法。
猜你喜欢
  • 2017-10-20
  • 2022-08-06
  • 2021-01-29
  • 1970-01-01
  • 2022-07-30
  • 1970-01-01
  • 1970-01-01
  • 2021-08-24
  • 1970-01-01
相关资源
最近更新 更多