Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b55412e

Browse files
committed
DOC improved our installation documentation
1 parent 0acf41e commit b55412e

File tree

1 file changed

+90
-170
lines changed

1 file changed

+90
-170
lines changed

INSTALL

Lines changed: 90 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,57 @@
77
Installing
88
==========
99

10-
There are many different ways to install matplotlib, and the best way
11-
depends on what operating system you are using, what you already have
12-
installed, and how you want to use it. To avoid wading through all
13-
the details (and potential complications) on this page, there are several
14-
convenient options.
10+
.. note::
1511

16-
Installing pre-built packages
17-
=============================
12+
If you wish to contribute to the project, it's recommended you
13+
:ref:`install the latest development version<install_from_source>`.
1814

19-
Most platforms : scientific Python distributions
20-
------------------------------------------------
2115

22-
The first option is to use one of the pre-packaged python
23-
distributions that already provide matplotlib built-in. The
24-
Continuum.io Python distribution (`Anaconda
25-
<https://www.continuum.io/downloads/>`_ or `miniconda
26-
<http://conda.pydata.org/miniconda.html>`_) and the Enthought
27-
distribution `(Canopy) <https://www.enthought.com/products/canopy/>`_
28-
are both excellent choices that "just work" out of the box for
29-
Windows, OSX and common Linux platforms. Both of these distributions
30-
include matplotlib and *lots* of other useful tools.
3116

17+
.. contents..
18+
19+
Installing an official release
20+
==============================
21+
22+
Matplotlib and most of its dependencies all available as wheel packages for
23+
OSX, windows and many linux distributions::
24+
25+
pip install -U numpy scipy scikit-learn
26+
27+
Third-party distributions of Matplotlib
28+
=======================================
29+
30+
Scientific Python distributions: Conda, Canopy...
31+
--------------------------------------------------
32+
33+
The first option is to use one of the pre-packaged Python distributions that
34+
already provide Matplotlib built-in. Both `Anaconda
35+
<https://www.continuum.io/downloads/>`_ and `Canopy
36+
<https://www.enthought.com/products/canopy/>`_ are both excellent choices that
37+
"just work" out of the box for Windows, OSX and common Linux platforms. Both
38+
of these distributions include Matplotlib and *lots* of other useful tools.
3239

3340
Linux : using your package manager
3441
----------------------------------
3542

36-
If you are on Linux, you might prefer to use your package manager. matplotlib
43+
If you are on Linux, you might prefer to use your package manager. Matplotlib
3744
is packaged for almost every major Linux distribution.
3845

3946
* Debian / Ubuntu : ``sudo apt-get install python-matplotlib``
4047
* Fedora / Redhat : ``sudo yum install python-matplotlib``
4148

42-
Mac OSX : using pip
43-
-------------------
44-
45-
If you are on Mac OSX you can probably install matplotlib binaries using the
46-
standard Python installation program pip_.
47-
See :ref:`install_osx_binaries`.
48-
4949
.. _installing_windows:
5050

5151
Windows
5252
-------
5353

54-
If you don't already have Python installed, we recommend using
55-
one of the `scipy-stack compatible Python distributions
54+
We strongly recommend using `scipy-stack compatible Python distributions
5655
<http://www.scipy.org/install.html>`_ such as WinPython, Python(x,y),
57-
Enthought Canopy, or Continuum Anaconda, which have matplotlib and many
58-
of its dependencies, plus other useful packages, preinstalled.
56+
Enthought Canopy, or Continuum Anaconda, which have Matplotlib and many of its
57+
dependencies, plus other useful packages, preinstalled.
5958

6059
For `standard Python <https://www.python.org/downloads/>`_ installations,
61-
install matplotlib using pip_::
60+
install Matplotlib using pip_::
6261

6362
python -m pip install -U pip setuptools
6463
python -m pip install matplotlib
@@ -103,7 +102,7 @@ for the official binaries. GTK3 is not supported on Windows.
103102
The Windows wheels (:file:`*.whl`) on the `PyPI download page
104103
<https://pypi.python.org/pypi/matplotlib/>`_ do not contain test data
105104
or example code.
106-
If you want to try the many demos that come in the matplotlib source
105+
If you want to try the many demos that come in the Matplotlib source
107106
distribution, download the :file:`*.tar.gz` file and look in the
108107
:file:`examples` subdirectory.
109108
To run the test suite:
@@ -123,12 +122,12 @@ To run the test suite:
123122
Installing from source
124123
======================
125124

126-
If you are interested in contributing to matplotlib development,
125+
If you are interested in contributing to Matplotlib development,
127126
running the latest source code, or just like to build everything
128-
yourself, it is not difficult to build matplotlib from source. Grab
127+
yourself, it is not difficult to build Matplotlib from source. Grab
129128
the latest *tar.gz* release file from `the PyPI files page
130129
<https://pypi.python.org/pypi/matplotlib/>`_, or if you want to
131-
develop matplotlib or just need the latest bugfixed version, grab the
130+
develop Matplotlib or just need the latest bugfixed version, grab the
132131
latest git version :ref:`install-from-git`.
133132

134133
The standard environment variables `CC`, `CXX`, `PKG_CONFIG` are respected.
@@ -141,7 +140,7 @@ cross compiling.
141140
export PKG_CONFIG=x86_64-pc-linux-gnu-pkg-config
142141

143142
Once you have satisfied the requirements detailed below (mainly
144-
python, numpy, libpng and freetype), you can build matplotlib.
143+
python, numpy, libpng and freetype), you can build Matplotlib.
145144
::
146145

147146
cd matplotlib
@@ -152,145 +151,66 @@ We provide a `setup.cfg
152151
<https://raw.githubusercontent.com/matplotlib/matplotlib/master/setup.cfg.template>`_
153152
file that goes with :file:`setup.py` which you can use to customize
154153
the build process. For example, which default backend to use, whether
155-
some of the optional libraries that matplotlib ships with are
154+
some of the optional libraries that Matplotlib ships with are
156155
installed, and so on. This file will be particularly useful to those
157-
packaging matplotlib.
156+
packaging Matplotlib.
158157

159158
If you have installed prerequisites to nonstandard places and need to
160-
inform matplotlib where they are, edit ``setupext.py`` and add the base
159+
inform Matplotlib where they are, edit ``setupext.py`` and add the base
161160
dirs to the ``basedir`` dictionary entry for your ``sys.platform``.
162161
e.g., if the header to some required library is in
163162
``/some/path/include/someheader.h``, put ``/some/path`` in the
164163
``basedir`` list for your platform.
165164

166165
.. _install_requirements:
167166

168-
Build requirements
169-
------------------
170-
171-
These are external packages which you will need to install before
172-
installing matplotlib. If you are building on OSX, see
173-
:ref:`build_osx`. If you are building on Windows, see
174-
:ref:`build_windows`. If you are installing dependencies with a
175-
package manager on Linux, you may need to install the development
176-
packages (look for a "-dev" postfix) in addition to the libraries
177-
themselves.
178-
179-
180-
Required Dependencies
181-
^^^^^^^^^^^^^^^^^^^^^
182-
183-
:term:`python` 2.7, 3.4, 3.5 or 3.6
184-
`Download python <https://www.python.org/downloads/>`_.
185-
186-
:term:`numpy` |minimum_numpy_version| (or later)
187-
array support for python (`download numpy <http://www.numpy.org>`_)
188-
189-
`setuptools <https://setuptools.readthedocs.io/en/latest/>`__
190-
Setuptools provides extensions for python package installation.
191-
192-
:term:`dateutil` 1.1 or later
193-
Provides extensions to python datetime handling. If using pip,
194-
easy_install or installing from source, the installer will attempt
195-
to download and install `python_dateutil` from PyPI.
196-
197-
`pyparsing <https://pyparsing.wikispaces.com/>`__
198-
Required for matplotlib's mathtext math rendering support. If
199-
using pip, easy_install or installing from source, the installer
200-
will attempt to download and install `pyparsing` from PyPI.
201-
202-
`libpng 1.2 (or later) <http://www.libpng.org>`__
203-
library for loading and saving :term:`PNG` files (`download
204-
<http://www.libpng.org/pub/png/libpng.html>`__). libpng requires
205-
zlib.
206-
207-
`pytz <http://pytz.sourceforge.net/>`__
208-
Used to manipulate time-zone aware datetimes.
209-
https://pypi.python.org/pypi/pytz
210-
211-
:term:`FreeType` 2.3 or later
212-
Library for reading true type font files. If using pip, easy_install or
213-
installing from source, the installer will attempt to locate FreeType in
214-
expected locations. If it cannot, try installing `pkg-config
215-
<http://matplotlib.org/users/installing.html#optional-dependencies>`__,
216-
a tool used to find required non-python libraries.
217-
218-
`cycler <http://matplotlib.org/cycler/>`__ 0.10.0 or later
219-
Composable cycle class used for constructing style-cycles
220-
221-
`six <https://pypi.python.org/pypi/six>`_
222-
Required for compatibility between python 2 and python 3
223-
224-
225-
Dependencies for python 2
226-
^^^^^^^^^^^^^^^^^^^^^^^^^
227-
228-
`backports.functools_lru_cache <https://pypi.python.org/pypi/backports.functools_lru_cache>`_
229-
Required for compatibility if running on Python 2.7.
230-
231-
`subprocess32 <https://pypi.python.org/pypi/subprocess32/>`_
232-
Optional, unix only. Backport of the subprocess standard library from 3.2+
233-
for Python 2.7. It provides better error messages and timeout support.
234-
235-
Optional GUI framework
236-
^^^^^^^^^^^^^^^^^^^^^^
237-
238-
These are optional packages which you may want to install to use
239-
matplotlib with a user interface toolkit. See
240-
:ref:`what-is-a-backend` for more details on the optional matplotlib
241-
backends and the capabilities they provide.
242-
243-
:term:`tk` 8.3 or later, not 8.6.0 or 8.6.1
244-
The TCL/Tk widgets library used by the TkAgg backend.
245-
246-
Versions 8.6.0 and 8.6.1 are known to have issues that may result
247-
in segfaults when closing multiple windows in the wrong order.
248-
249-
:term:`pyqt` 4.4 or later
250-
The Qt4 widgets library python wrappers for the Qt4Agg backend
251-
252-
:term:`pygtk` 2.4 or later
253-
The python wrappers for the GTK widgets library for use with the
254-
GTK or GTKAgg backend
255-
256-
:term:`wxpython` 2.8 or later
257-
The python wrappers for the wx widgets library for use with the
258-
WX or WXAgg backend
259-
260-
Optional external programs
261-
^^^^^^^^^^^^^^^^^^^^^^^^^^
262-
`ffmpeg <https://www.ffmpeg.org/>`__/`avconv <https://libav.org/avconv.html>`__ or `mencoder <http://www.mplayerhq.hu/design7/news.html>`__
263-
Required for the animation module to be save out put to movie
264-
formats.
265-
266-
`ImageMagick <http://www.imagemagick.org/script/index.php>`__
267-
Required for the animation module to be able to save to animated gif.
268-
269-
Optional dependencies
270-
^^^^^^^^^^^^^^^^^^^^^
271-
272-
`Pillow <http://python-pillow.org/>`__
273-
If Pillow is installed, matplotlib can read and write a larger
274-
selection of image file formats.
275-
276-
`pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config/>`__
277-
A tool used to find required non-python libraries. This is not strictly
278-
required, but can make installation go more smoothly if the libraries and
279-
headers are not in the expected locations.
280-
281-
282-
Required libraries that ship with matplotlib
283-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
284-
:term:`agg` 2.4
285-
The antigrain C++ rendering engine. matplotlib links against the
286-
agg template source statically, so it will not affect anything on
287-
your system outside of matplotlib.
288-
289-
`qhull` 2012.1
290-
A library for computing Delaunay triangulations.
291-
292-
`ttconv`
293-
truetype font utility
167+
Dependencies
168+
------------
169+
170+
Matplotlib requires a large number of dependencies:
171+
172+
* `Python <https://www.python.org/downloads/>`_ (>= 2.7 or >= 3.4)
173+
* `numpy <http://www.numpy.org>`_ (>= |minimum_numpy_version|)
174+
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`__
175+
* `dateutil` (>= 1.1)
176+
* `pyparsing <https://pyparsing.wikispaces.com/>`__
177+
* `libpng <http://www.libpng.org>`__ ( >= 1.2)
178+
* `pytz <http://pytz.sourceforge.net/>`__
179+
* FreeType` (>= 2.3)
180+
* `cycler <http://matplotlib.org/cycler/>`__ (>= 0.10.0)
181+
* `six <https://pypi.python.org/pypi/six>`_
182+
* `backports.functools_lru_cache <https://pypi.python.org/pypi/backports.functools_lru_cache>`_
183+
(for Python 2.7 only)
184+
* `subprocess32 <https://pypi.python.org/pypi/subprocess32/>`_ (for Python
185+
2.7 only)
186+
187+
Optionally, you can also install a number of packages to enables better user
188+
interface toolkit. See :ref:`what-is-a-backend` for more details on the
189+
optional Matplotlib backends and the capabilities they provide.
190+
191+
* :term:`tk` (>= 8.3, != 8.6.0 or 8.6.1): for the TkAgg backend;
192+
* :term:`pyqt` (>= 4.4): for the Qt4Agg backend;
193+
* :term:`pygtk` (>= 2.4): for the GTK and the GTKAgg backend;
194+
* :term:`wxpython` (>= 2.8 or later): for the WX or WXAgg backend.
195+
196+
For better support of animation output format and image file format, you can
197+
install the following:
198+
199+
* `ffmpeg <https://www.ffmpeg.org/>`__/`avconv
200+
<https://libav.org/avconv.html>`__ or `mencoder
201+
<http://www.mplayerhq.hu/design7/news.html>`__ (for saving movies);
202+
* `ImageMagick <http://www.imagemagick.org/script/index.php>`__ (for saving
203+
animated gifs);
204+
* `Pillow <http://python-pillow.org/>`__ (for a larger selection of image
205+
file format).
206+
207+
.. note::
208+
209+
Matplotlib depends on a large number of non-python libraries.
210+
`pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config/>`__
211+
can be used to find required non-python libraries and thus make install go
212+
more smoothly if the libraries and headers are not in the expected
213+
locations.
294214

295215

296216
.. _build_linux:
@@ -301,17 +221,17 @@ Building on Linux
301221
It is easiest to use your system package manager to install the dependencies.
302222

303223
If you are on Debian/Ubuntu, you can get all the dependencies
304-
required to build matplotlib with::
224+
required to build Matplotlib with::
305225

306226
sudo apt-get build-dep python-matplotlib
307227

308228
If you are on Fedora/RedHat, you can get all the dependencies required
309-
to build matplotlib by first installing ``yum-builddep`` and then
229+
to build Matplotlib by first installing ``yum-builddep`` and then
310230
running::
311231

312232
su -c "yum-builddep python-matplotlib"
313233

314-
This does not build matplotlib, but it does get and install the
234+
This does not build Matplotlib, but it does get and install the
315235
build dependencies, which will make building from source easier.
316236

317237

@@ -340,7 +260,7 @@ Example usage::
340260

341261
port install libpng freetype pkgconfig
342262

343-
To install matplotlib from source, execute:
263+
To install Matplotlib from source, execute:
344264

345265
Example usage::
346266

@@ -387,7 +307,7 @@ how to install and setup such environments. If in doubt: use python 3.5 as it mo
387307
without fiddling with environment variables::
388308

389309
# create a new environment with the required packages
390-
conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado "cycler>=0.10" tk libpng zlib freetype
310+
conda create -n "matplotlib_build" python=3.5 numpy python-dateutil pyparsing pytz tornado "cycler>=0.10" tk libpng zlib freetype
391311
activate matplotlib_build
392312
# if you want a qt backend, you also have to install pyqt (be aware that pyqt doesn't mix well if
393313
# you have created the environment with conda-forge already activated...)

0 commit comments

Comments
 (0)