如何在 Ubuntu 16.04 LTS 中安装枕头?

mat*_*age 10 lts python3 16.04

我去这个网站安装 Pillow,因为原来的 PIL 是一个停产的项目,所以现在不太好用。但是,表中没有提到对 Ubuntu 16.04 LTS 的支持。它既没有出现在4.2.x 安装指南中,也没有出现在3.0.0 安装指南中

此外,据说仅安装枕头是不够的。有一些依赖项应该首先安装,Ubuntu 16.04 LTS 也没有提到。为 14.04 LTS 提供的 Pillow for python 3 安装步骤是否适用于 Ubuntu 16.04 LTS?

如果没有,如何在 Python 3.6 的 16.04 LTS 中安装枕头?(支持 Python 2。)

kar*_*rel 15

根据维基百科Pillow在 Ubuntu 13.04 及更高版本中被打包为python-pilpython3-pil

要在 Ubuntu 16.04 及更高版本(以及 Ubuntu 14.04)中安装 Python Imaging Library,请打开终端并键入:

sudo apt install python-pil # for python 2.X
Run Code Online (Sandbox Code Playgroud)

和/或...

sudo apt install python3-pil # for python 3.X including python3.6
Run Code Online (Sandbox Code Playgroud)

如果 imageTk 导入不起作用,请执行以下操作:

sudo apt install python3-pil.imagetk
Run Code Online (Sandbox Code Playgroud)

  • Pillow 在 Ubuntu 16.04 中打包为 Python 2.X 的 *python-pil* 或 Python 3.X 的 *python3-pil*。因此,在 Ubuntu 16.04 中,您将获得 Pillow,而不是来自默认 Ubuntu 存储库的已停产的 PIL 项目包。 (2认同)