How do I install pillow in Ubuntu 16.04 LTS?

According to Wikipedia Pillow is packaged as python-pil and python3-pil in Ubuntu 13.04 and later.

To install the Python Imaging Library in Ubuntu 16.04 and later (and also in Ubuntu 14.04), open the terminal and type:

sudo apt install python-pil # for python 2.X

and/or...

sudo apt install python3-pil # for python 3.X including python3.6

And if the imageTk import doesn't work, just do this:

sudo apt install python3-pil.imagetk

Ubuntu 18.04 and Python 3

This will interest users past Ubuntu 16.04 LTS: install_pillow.sh

#!/bin/bash

apt update
apt install python3-pip -y
apt install libjpeg8-dev zlib1g-dev libtiff-dev libfreetype6 libfreetype6-dev libwebp-dev libopenjp2-7-dev libopenjp2-7-dev -y

pip3 install pillow --global-option="build_ext" --global-option="--enable-zlib" --global-option="--enable-jpeg" --global-option="--enable-tiff" --global-option="--enable-freetype" --global-option="--enable-webp" --global-option="--enable-webpmux" --global-option="--enable-jpeg2000"

This also addresses some of the "dependencies" which I believe OP was referring to:

  • Many of Pillow’s features require external libraries

Tags:

Lts

Python3

16.04