【发布时间】:2014-07-21 02:57:18
【问题描述】:
我在使用 Pillow 和 Python 3.3.2 时运气不佳,如果能提供一些帮助,我将不胜感激。我的问题是安装 Pillow 后,无法导入 Image。
我的设置: 我已经安装了 Linux Mint 16(在 HP Pavilion dv7 笔记本电脑上)。 我已经安装了 Python 3.3.2+,它工作正常。 我已经安装了 Python 2.7.5+,它运行良好。
我做了什么: 我按照http://pillow.readthedocs.org/en/latest/index.html 的说明安装了 Pillow v2.4.0 (PIL fork):
我开始:
~$ pip install Pillow
我安装了 python-setuptools:
~$ sudo apt-get install python-dev python-setuptools
还有,对于 python 3:
~$ sudo apt-get install python3-dev python3-setuptools
因此,我在 Ubuntu 12.04 LTS 上安装了“先决条件”:
~$ sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk
(Mint 16 基于 Ubuntu 13.10,但我没有找到任何更高版本的先决条件列表)
发生了什么: 使用python 2, 导入图片 工作,我可以打开一个.png图像并显示它。 但是对于 python 3, '导入图像' 给出'没有名为 Image 的模块' 和 '从 PIL 导入图像' 给 '没有名为 PIL 的模块'
任何帮助将不胜感激。
【问题讨论】:
标签: python-3.3 pillow