Incompatibility with python3-pil v7.0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
matplotlib (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I am using Ubuntu 20.04.1 LTS (including python3-matplotlib 3.1.2-1ubuntu4)
To save a figure using matplotlib.pyplot into a jpg file, matplotlib uses Python Imaging Library (PIL). Unfortunately even if we install the package python3-pil 7.0.0-4ubuntu0.1 it fails:
File "/usr/lib/
raise ValueError(
ValueError: Format 'jpg' is not supported (supported formats: eps, pdf, pgf, png, ps, raw, rgba, svg, svgz)
The reason is matplotlib detect PIL version by doing so (in file backend_bases.py line 57):
from PIL import PILLOW_VERSION
PILLOW_VERSION has been removed since PIL version 7.0 to be replaced by PIL.__version__
To solve this issue it seems that you have to upgrade python3-matplotlib package at least to version 3.3 (the version packaged for ubuntu 20.10, I think)
I encountered the same problem.
> To solve this issue it seems that you have to upgrade python3-matplotlib package at least to version 3.3 (the version packaged for ubuntu 20.10, I think)
v3.1.3 also supports pillow >= 7.0. This version might be more appropriate.
https:/ /github. com/matplotlib/ matplotlib/ releases/ tag/v3. 1.3
> - support pillow >= 7
Original fix. /github. com/matplotlib/ matplotlib/ pull/16086
https:/
This fix is applied to v3.1.3 /github. com/matplotlib/ matplotlib/ blob/v3. 1.3/lib/ matplotlib/ backend_ bases.py# L57
https:/