@@ -14,8 +14,8 @@ Installing
1414Installing an official release
1515==============================
1616
17- Matplotlib and most of its dependencies are all available as wheel
18- packages for macOS, Windows and Linux distributions::
17+ Matplotlib and its dependencies are available as wheel packages for macOS,
18+ Windows and Linux distributions::
1919
2020 python -mpip install -U pip
2121 python -mpip install -U matplotlib
@@ -32,14 +32,12 @@ Although not required, we suggest also installing ``IPython`` for
3232interactive use. To easily install a complete Scientific Python
3333stack, see :ref: `install_scipy_dists ` below.
3434
35-
3635macOS
3736-----
3837
3938To use the native OSX backend you will need :ref: `a framework build
4039<osxframework-faq>` build of Python.
4140
42-
4341Test Data
4442---------
4543
@@ -51,14 +49,13 @@ distribution, download the :file:`*.tar.gz` file and look in the
5149:file: `examples ` subdirectory.
5250To run the test suite:
5351
54- * extract the :file: `lib\\ matplotlib\\ tests ` or
55- :file: `lib\\ mpl_toolkits\\ tests ` directories from the source distribution;
52+ * extract the :file: `lib/ matplotlib/ tests ` or
53+ :file: `lib/ mpl_toolkits/ tests ` directories from the source distribution;
5654 * install test dependencies: `pytest <https://pypi.python.org/pypi/pytest >`_,
5755 Pillow, MiKTeX, GhostScript, ffmpeg, avconv, ImageMagick, and `Inkscape
5856 <https://inkscape.org/> `_;
5957 * run ``pytest path\to\tests\directory ``.
6058
61-
6259Third-party distributions of Matplotlib
6360=======================================
6461
@@ -75,7 +72,6 @@ Linux platforms. `WinPython <https://winpython.github.io/>`__ is an
7572option for windows users. All of these distributions include
7673Matplotlib and *lots * of other useful (data) science tools.
7774
78-
7975Linux : using your package manager
8076----------------------------------
8177
@@ -87,8 +83,6 @@ is packaged for almost every major Linux distribution.
8783* Red Hat: ``sudo yum install python3-matplotlib ``
8884* Arch: ``sudo pacman -S python-matplotlib ``
8985
90-
91-
9286.. _install_from_source :
9387
9488Installing from source
@@ -137,7 +131,7 @@ e.g., if the header of some required library is in
137131Dependencies
138132------------
139133
140- Matplotlib requires a large number of dependencies:
134+ Matplotlib requires the following dependencies:
141135
142136 * `Python <https://www.python.org/downloads/ >`_ (>= 3.5)
143137 * `NumPy <http://www.numpy.org >`_ (>= |minimum_numpy_version |)
@@ -148,7 +142,7 @@ Matplotlib requires a large number of dependencies:
148142 * `pytz <http://pytz.sourceforge.net/ >`__
149143 * FreeType (>= 2.3)
150144 * `cycler <http://matplotlib.org/cycler/ >`__ (>= 0.10.0)
151- * `six <https://pypi.python.org/pypi/six >`_
145+ * `six <https://pypi.python.org/pypi/six >`_ (>= 1.10)
152146 * `kiwisolver <https://github.com/nucleic/kiwi >`__ (>= 1.0.0)
153147
154148Optionally, you can also install a number of packages to enable better user
@@ -172,18 +166,17 @@ etc., you can install the following:
172166 <https://libav.org/avconv.html> `_: for saving movies;
173167 * `ImageMagick <https://www.imagemagick.org/script/index.php >`_: for saving
174168 animated gifs;
175- * `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
176170 image file formats: JPEG, BMP, and TIFF image files;
177171 * `LaTeX <https://miktex.org/ >`_ and `GhostScript
178172 <https://ghostscript.com/download/> `_ (for rendering text with LaTeX).
179173
180174.. note ::
181175
182- Matplotlib depends on a large number of non-Python libraries.
183- `pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config/ >`__
184- can be used to find required non-Python libraries and thus make the install
185- go more smoothly if the libraries and headers are not in the expected
186- locations.
176+ Matplotlib depends on non-Python libraries. `pkg-config
177+ <https://www.freedesktop.org/wiki/Software/pkg-config/> `__ can be used
178+ to find required non-Python libraries and thus make the install go more
179+ smoothly if the libraries and headers are not in the expected locations.
187180
188181.. note ::
189182
@@ -218,7 +211,6 @@ Matplotlib by first installing ``yum-builddep`` and then running::
218211These commands do not build Matplotlib, but instead get and install the
219212build dependencies, which will make building from source easier.
220213
221-
222214.. _build_osx :
223215
224216Building on macOS
@@ -250,22 +242,21 @@ found that, to run the tests, their PYTHONPATH must include
250242/path/to/anaconda/.../site-packages and their DYLD_FALLBACK_LIBRARY_PATH
251243must include /path/to/anaconda/lib.
252244
253-
254245.. _build_windows :
255246
256247Building on Windows
257248-------------------
258249
259250The Python shipped from https://www.python.org is compiled with Visual Studio
260- 2008 for versions before 3.3, Visual Studio 2010 for 3.3 and 3.4, and
261- Visual Studio 2015 for 3.5 and 3.6. Python extensions are recommended to be compiled
262- with the same compiler.
251+ 2015 for 3.5 and 3.6. Python extensions should be compiled with the same
252+ compiler, see e.g.
253+ https://packaging.python.org/guides/packaging-binary-extensions/#setting-up-a-build-environment-on-windows
254+ for how to set up a build environment.
263255
264256Since there is no canonical Windows package manager, the methods for building
265257FreeType, zlib, and libpng from source code are documented as a build script
266258at `matplotlib-winbuild <https://github.com/jbmohler/matplotlib-winbuild >`_.
267259
268-
269260There are a few possibilities to build Matplotlib on Windows:
270261
271262* Wheels via `matplotlib-winbuild <https://github.com/jbmohler/matplotlib-winbuild >`_
@@ -275,17 +266,14 @@ There are a few possibilities to build Matplotlib on Windows:
275266Wheel builds using conda packages
276267^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
277268
278- This is a wheel build, but we use conda packages to get all the requirements. The binary
279- requirements (png, FreeType,...) are statically linked and therefore not needed during the wheel
280- install.
269+ This is a wheel build, but we use conda packages to get all the requirements.
270+ The binary requirements (png, FreeType,...) are statically linked and therefore
271+ not needed during the wheel install.
281272
282- The commands below assume that you can compile a native Python lib for the Python version of your
283- choice. See `this howto <https://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/ >`_
284- for how to install and setup such environments. If in doubt: use Python >= 3.5 as it mostly works
285- without fiddling with environment variables::
273+ ::
286274
287275 # create a new environment with the required packages
288- conda create -n "matplotlib_build" python=3.5 numpy python-dateutil pyparsing pytz tornado " cycler>=0.10" tk libpng zlib freetype
276+ conda create -n "matplotlib_build" python=3.5 numpy python-dateutil pyparsing pytz tornado cycler tk libpng zlib freetype
289277 activate matplotlib_build
290278 # if you want a qt backend, you also have to install pyqt (be aware that pyqt doesn't mix well if
291279 # you have created the environment with conda-forge already activated...)
@@ -294,38 +282,23 @@ without fiddling with environment variables::
294282 conda install -c conda-forge msinttypes
295283
296284 # copy the libs which have "wrong" names
297- set LIBRARY_LIB=%CONDA_DEFAULT_ENV %\Library\lib
285+ set LIBRARY_LIB=%CONDA_PREFIX %\Library\lib
298286 mkdir lib || cmd /c "exit /b 0"
299287 copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
300288 copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib
301289
302290 # Make the header files and the rest of the static libs available during the build
303291 # CONDA_DEFAULT_ENV is a env variable which is set to the currently active environment path
304- set MPLBASEDIRLIST=%CONDA_DEFAULT_ENV %\Library\;.
292+ set MPLBASEDIRLIST=%CONDA_PREFIX %\Library\;.
305293
306294 # build the wheel
307295 python setup.py bdist_wheel
308296
309297The `build_alllocal.cmd ` script in the root folder automates these steps if
310298you have already created and activated the conda environment.
311299
312-
313300Conda packages
314301^^^^^^^^^^^^^^
315302
316- This needs a `working installed C compiler
317- <https://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/> `_
318- for the version of Python you are compiling the package for but you don't need
319- to setup the environment variables::
320-
321- # only the first time...
322- conda install conda-build
323-
324- # the Python version you want a package for...
325- set CONDA_PY=3.5
326-
327- # builds the package, using a clean build environment
328- conda build ci\conda_recipe
329-
330- # install the new package
331- conda install --use-local matplotlib
303+ The conda packaging scripts for Matplotlib are available at
304+ https://github.com/conda-forge/python-feedstock.
0 commit comments