@@ -14,8 +14,8 @@ Installing
14
14
Installing an official release
15
15
==============================
16
16
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::
19
19
20
20
python -mpip install -U pip
21
21
python -mpip install -U matplotlib
@@ -32,14 +32,12 @@ Although not required, we suggest also installing ``IPython`` for
32
32
interactive use. To easily install a complete Scientific Python
33
33
stack, see :ref: `install_scipy_dists ` below.
34
34
35
-
36
35
macOS
37
36
-----
38
37
39
38
To use the native OSX backend you will need :ref: `a framework build
40
39
<osxframework-faq>` build of Python.
41
40
42
-
43
41
Test Data
44
42
---------
45
43
@@ -51,14 +49,13 @@ distribution, download the :file:`*.tar.gz` file and look in the
51
49
:file: `examples ` subdirectory.
52
50
To run the test suite:
53
51
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;
56
54
* install test dependencies: `pytest <https://pypi.python.org/pypi/pytest >`_,
57
55
Pillow, MiKTeX, GhostScript, ffmpeg, avconv, ImageMagick, and `Inkscape
58
56
<https://inkscape.org/> `_;
59
57
* run ``pytest path\to\tests\directory ``.
60
58
61
-
62
59
Third-party distributions of Matplotlib
63
60
=======================================
64
61
@@ -75,7 +72,6 @@ Linux platforms. `WinPython <https://winpython.github.io/>`__ is an
75
72
option for windows users. All of these distributions include
76
73
Matplotlib and *lots * of other useful (data) science tools.
77
74
78
-
79
75
Linux : using your package manager
80
76
----------------------------------
81
77
@@ -87,8 +83,6 @@ is packaged for almost every major Linux distribution.
87
83
* Red Hat: ``sudo yum install python3-matplotlib ``
88
84
* Arch: ``sudo pacman -S python-matplotlib ``
89
85
90
-
91
-
92
86
.. _install_from_source :
93
87
94
88
Installing from source
@@ -137,7 +131,7 @@ e.g., if the header of some required library is in
137
131
Dependencies
138
132
------------
139
133
140
- Matplotlib requires a large number of dependencies:
134
+ Matplotlib requires the following dependencies:
141
135
142
136
* `Python <https://www.python.org/downloads/ >`_ (>= 3.5)
143
137
* `NumPy <http://www.numpy.org >`_ (>= |minimum_numpy_version |)
@@ -179,11 +173,10 @@ etc., you can install the following:
179
173
180
174
.. note ::
181
175
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.
187
180
188
181
.. note ::
189
182
@@ -218,7 +211,6 @@ Matplotlib by first installing ``yum-builddep`` and then running::
218
211
These commands do not build Matplotlib, but instead get and install the
219
212
build dependencies, which will make building from source easier.
220
213
221
-
222
214
.. _build_osx :
223
215
224
216
Building on macOS
@@ -250,22 +242,21 @@ found that, to run the tests, their PYTHONPATH must include
250
242
/path/to/anaconda/.../site-packages and their DYLD_FALLBACK_LIBRARY_PATH
251
243
must include /path/to/anaconda/lib.
252
244
253
-
254
245
.. _build_windows :
255
246
256
247
Building on Windows
257
248
-------------------
258
249
259
250
The 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.
263
255
264
256
Since there is no canonical Windows package manager, the methods for building
265
257
FreeType, zlib, and libpng from source code are documented as a build script
266
258
at `matplotlib-winbuild <https://github.com/jbmohler/matplotlib-winbuild >`_.
267
259
268
-
269
260
There are a few possibilities to build Matplotlib on Windows:
270
261
271
262
* Wheels via `matplotlib-winbuild <https://github.com/jbmohler/matplotlib-winbuild >`_
@@ -275,17 +266,14 @@ There are a few possibilities to build Matplotlib on Windows:
275
266
Wheel builds using conda packages
276
267
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
277
268
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.
281
272
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
+ ::
286
274
287
275
# 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
289
277
activate matplotlib_build
290
278
# if you want a qt backend, you also have to install pyqt (be aware that pyqt doesn't mix well if
291
279
# you have created the environment with conda-forge already activated...)
@@ -309,23 +297,8 @@ without fiddling with environment variables::
309
297
The `build_alllocal.cmd ` script in the root folder automates these steps if
310
298
you have already created and activated the conda environment.
311
299
312
-
313
300
Conda packages
314
301
^^^^^^^^^^^^^^
315
302
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