Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9b3ac28

Browse filesBrowse files
authored
Merge pull request #11132 from ImportanceOfBeingErnest/pillow-dependency
pillow-dependency update
2 parents 17b6c30 + 5e858a6 commit 9b3ac28
Copy full SHA for 9b3ac28

File tree

Expand file treeCollapse file tree

3 files changed

+11
-7
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+11
-7
lines changed

‎INSTALL.rst

Copy file name to clipboardExpand all lines: INSTALL.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Matplotlib requires the following dependencies:
142142
* `pytz <http://pytz.sourceforge.net/>`__
143143
* FreeType (>= 2.3)
144144
* `cycler <http://matplotlib.org/cycler/>`__ (>= 0.10.0)
145-
* `six <https://pypi.python.org/pypi/six>`_
145+
* `six <https://pypi.python.org/pypi/six>`_ (>= 1.10)
146146
* `kiwisolver <https://github.com/nucleic/kiwi>`__ (>= 1.0.0)
147147

148148
Optionally, you can also install a number of packages to enable better user
@@ -166,7 +166,7 @@ etc., you can install the following:
166166
<https://libav.org/avconv.html>`_: for saving movies;
167167
* `ImageMagick <https://www.imagemagick.org/script/index.php>`_: for saving
168168
animated gifs;
169-
* `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>=2.0): for a larger selection of
169+
* `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>=3.4): for a larger selection of
170170
image file formats: JPEG, BMP, and TIFF image files;
171171
* `LaTeX <https://miktex.org/>`_ and `GhostScript
172172
<https://ghostscript.com/download/>`_ (for rendering text with LaTeX).

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@
5555

5656
try:
5757
from PIL import Image
58-
_has_pil = True
58+
from PIL import PILLOW_VERSION
59+
from distutils.version import LooseVersion
60+
if LooseVersion(PILLOW_VERSION) >= LooseVersion("3.4"):
61+
_has_pil = True
62+
else:
63+
_has_pil = False
5964
del Image
6065
except ImportError:
6166
_has_pil = False

‎lib/matplotlib/backends/backend_agg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_agg.py
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@
4242
from matplotlib.backends._backend_agg import RendererAgg as _RendererAgg
4343
from matplotlib import _png
4444

45-
try:
45+
from matplotlib.backend_bases import _has_pil
46+
47+
if _has_pil:
4648
from PIL import Image
47-
_has_pil = True
48-
except ImportError:
49-
_has_pil = False
5049

5150
backend_version = 'v2.2'
5251

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.