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

Skip to content

Commit 1b9ad39

Browse files
committed
Re-arrange installation doc layout
This ensures that the ToC as generated in the PDF makes sense, and doesn't appear in the wrong order. Also fixes the redirect to come from the right place.
1 parent a99ba43 commit 1b9ad39

File tree

10 files changed

+179
-190
lines changed

10 files changed

+179
-190
lines changed

INSTALL.rst

Lines changed: 1 addition & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1 @@
1-
############
2-
Installation
3-
############
4-
5-
==============================
6-
Installing an official release
7-
==============================
8-
9-
Matplotlib releases are available as wheel packages for macOS, Windows and
10-
Linux on `PyPI <https://pypi.org/project/matplotlib/>`_. Install it using
11-
``pip``:
12-
13-
.. code-block:: sh
14-
15-
python -m pip install -U pip
16-
python -m pip install -U matplotlib
17-
18-
If this command results in Matplotlib being compiled from source and
19-
there's trouble with the compilation, you can add ``--prefer-binary`` to
20-
select the newest version of Matplotlib for which there is a
21-
precompiled wheel for your OS and Python.
22-
23-
.. note::
24-
25-
The following backends work out of the box: Agg, ps, pdf, svg
26-
27-
Python is typically shipped with tk bindings which are used by
28-
TkAgg.
29-
30-
For support of other GUI frameworks, LaTeX rendering, saving
31-
animations and a larger selection of file formats, you can
32-
install :ref:`optional_dependencies`.
33-
34-
=========================
35-
Third-party distributions
36-
=========================
37-
38-
Various third-parties provide Matplotlib for their environments.
39-
40-
Conda packages
41-
==============
42-
Matplotlib is available both via the *anaconda main channel*
43-
44-
.. code-block:: sh
45-
46-
conda install matplotlib
47-
48-
as well as via the *conda-forge community channel*
49-
50-
.. code-block:: sh
51-
52-
conda install -c conda-forge matplotlib
53-
54-
Python distributions
55-
====================
56-
57-
Matplotlib is part of major Python distributions:
58-
59-
- `Anaconda <https://www.anaconda.com/>`_
60-
61-
- `ActiveState ActivePython
62-
<https://www.activestate.com/products/python/downloads/>`_
63-
64-
- `WinPython <https://winpython.github.io/>`_
65-
66-
Linux package manager
67-
=====================
68-
69-
If you are using the Python version that comes with your Linux distribution,
70-
you can install Matplotlib via your package manager, e.g.:
71-
72-
* Debian / Ubuntu: ``sudo apt-get install python3-matplotlib``
73-
* Fedora: ``sudo dnf install python3-matplotlib``
74-
* Red Hat: ``sudo yum install python3-matplotlib``
75-
* Arch: ``sudo pacman -S python-matplotlib``
76-
77-
======================
78-
Installing from source
79-
======================
80-
See :ref:`install_from_source`.
81-
82-
==========================
83-
Installing for development
84-
==========================
85-
See :ref:`installing_for_devs`.
86-
87-
==============
88-
Installing FAQ
89-
==============
90-
91-
See :ref:`installing-faq`.
1+
See doc/users/installing.rst

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ various graphical user interface toolkits.
5858
Install
5959
=======
6060

61-
For installation instructions and requirements, see `INSTALL.rst <INSTALL.rst>`_ or the
62-
`install <https://matplotlib.org/stable/users/installing.html>`_ documentation.
61+
For installation instructions and requirements, see the `install documentation
62+
<https://matplotlib.org/stable/users/installing.html>`_ or `installing.rst
63+
<doc/users/installing.rst>`_ in the source.
6364

6465
Contribute
6566
==========

doc/api/prev_api_changes/api_changes_3.1.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ FreeType or libpng are not in the compiler or linker's default path, set the
308308
standard environment variables ``CFLAGS``/``LDFLAGS`` on Linux or OSX, or
309309
``CL``/``LINK`` on Windows, to indicate the relevant paths.
310310

311-
See details in :doc:`/users/installing/index`.
311+
See details in :doc:`/users/installing`.
312312

313313
Setting artist properties twice or more in the same call
314314
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

doc/devel/documenting_mpl.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,22 +197,22 @@ Documents can be linked with the ``:doc:`` directive:
197197

198198
.. code-block:: rst
199199
200-
See the :doc:`/users/faq/installing_faq`
200+
See the :doc:`/users/installing`
201201
202202
See the tutorial :doc:`/tutorials/introductory/usage`
203203
204204
See the example :doc:`/gallery/lines_bars_and_markers/simple_plot`
205205
206206
will render as:
207207

208-
See the :doc:`/users/faq/installing_faq`
208+
See the :doc:`/users/installing`
209209

210210
See the tutorial :doc:`/tutorials/introductory/usage`
211211

212212
See the example :doc:`/gallery/lines_bars_and_markers/simple_plot`
213213

214214
Sections can also be given reference names. For instance from the
215-
:doc:`/users/faq/installing_faq` link:
215+
:doc:`/users/installing` link:
216216

217217
.. code-block:: rst
218218

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Installation
3434
3535
conda install matplotlib
3636
37-
Further details are available in the :doc:`Installation Guide <users/installing/index>`.
37+
Further details are available in the :doc:`Installation Guide <users/installing>`.
3838

3939

4040
******************

doc/users/getting_started/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Installation quick-start
2222
2323
conda install matplotlib
2424
25-
Further details are available in the :doc:`Installation Guide </users/installing/index>`.
25+
Further details are available in the :doc:`Installation Guide </users/installing>`.
2626

2727

2828
Draw a first plot

doc/users/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ General
1414
:maxdepth: 2
1515

1616
getting_started/index.rst
17-
installing/index.rst
17+
installing.rst
1818
explain/index.rst
1919
faq/index.rst
2020
resources/index.rst

doc/users/faq/installing_faq.rst renamed to doc/users/installing.rst

Lines changed: 168 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,177 @@
1-
.. _installing-faq:
1+
.. redirect-from:: /users/installing/index
2+
3+
############
4+
Installation
5+
############
6+
7+
==============================
8+
Installing an official release
9+
==============================
10+
11+
Matplotlib releases are available as wheel packages for macOS, Windows and
12+
Linux on `PyPI <https://pypi.org/project/matplotlib/>`_. Install it using
13+
``pip``:
14+
15+
.. code-block:: sh
16+
17+
python -m pip install -U pip
18+
python -m pip install -U matplotlib
19+
20+
If this command results in Matplotlib being compiled from source and
21+
there's trouble with the compilation, you can add ``--prefer-binary`` to
22+
select the newest version of Matplotlib for which there is a
23+
precompiled wheel for your OS and Python.
24+
25+
.. note::
26+
27+
The following backends work out of the box: Agg, ps, pdf, svg
28+
29+
Python is typically shipped with tk bindings which are used by
30+
TkAgg.
31+
32+
For support of other GUI frameworks, LaTeX rendering, saving
33+
animations and a larger selection of file formats, you can
34+
install :ref:`optional_dependencies`.
35+
36+
=========================
37+
Third-party distributions
38+
=========================
39+
40+
Various third-parties provide Matplotlib for their environments.
41+
42+
Conda packages
43+
==============
44+
Matplotlib is available both via the *anaconda main channel*
45+
46+
.. code-block:: sh
47+
48+
conda install matplotlib
49+
50+
as well as via the *conda-forge community channel*
51+
52+
.. code-block:: sh
53+
54+
conda install -c conda-forge matplotlib
55+
56+
Python distributions
57+
====================
58+
59+
Matplotlib is part of major Python distributions:
60+
61+
- `Anaconda <https://www.anaconda.com/>`_
62+
63+
- `ActiveState ActivePython
64+
<https://www.activestate.com/products/python/downloads/>`_
65+
66+
- `WinPython <https://winpython.github.io/>`_
67+
68+
Linux package manager
69+
=====================
70+
71+
If you are using the Python version that comes with your Linux distribution,
72+
you can install Matplotlib via your package manager, e.g.:
73+
74+
* Debian / Ubuntu: ``sudo apt-get install python3-matplotlib``
75+
* Fedora: ``sudo dnf install python3-matplotlib``
76+
* Red Hat: ``sudo yum install python3-matplotlib``
77+
* Arch: ``sudo pacman -S python-matplotlib``
78+
79+
.. redirect-from:: /users/installing/installing_source
80+
81+
.. _install_from_source:
82+
83+
======================
84+
Installing from source
85+
======================
86+
87+
If you are interested in contributing to Matplotlib development,
88+
running the latest source code, or just like to build everything
89+
yourself, it is not difficult to build Matplotlib from source.
90+
91+
First you need to install the :ref:`dependencies`.
92+
93+
A C compiler is required. Typically, on Linux, you will need ``gcc``, which
94+
should be installed using your distribution's package manager; on macOS, you
95+
will need xcode_; on Windows, you will need Visual Studio 2015 or later.
96+
97+
.. _xcode: https://guide.macports.org/chunked/installing.html#installing.xcode
98+
99+
The easiest way to get the latest development version to start contributing
100+
is to go to the git `repository <https://github.com/matplotlib/matplotlib>`_
101+
and run::
102+
103+
git clone https://github.com/matplotlib/matplotlib.git
104+
105+
or::
106+
107+
git clone [email protected]:matplotlib/matplotlib.git
108+
109+
If you're developing, it's better to do it in editable mode. The reason why
110+
is that pytest's test discovery only works for Matplotlib
111+
if installation is done this way. Also, editable mode allows your code changes
112+
to be instantly propagated to your library code without reinstalling (though
113+
you will have to restart your python process / kernel)::
114+
115+
cd matplotlib
116+
python -m pip install -e .
117+
118+
If you're not developing, it can be installed from the source directory with
119+
a simple (just replace the last step)::
120+
121+
python -m pip install .
122+
123+
To run the tests you will need to install some additional dependencies::
124+
125+
python -m pip install -r requirements/dev/dev-requirements.txt
126+
127+
Then, if you want to update your Matplotlib at any time, just do::
128+
129+
git pull
130+
131+
When you run ``git pull``, if the output shows that only Python files have
132+
been updated, you are all set. If C files have changed, you need to run ``pip
133+
install -e .`` again to compile them.
134+
135+
There is more information on :ref:`using git <using-git>` in the developer
136+
docs.
137+
138+
.. warning::
139+
140+
The following instructions in this section are for very custom
141+
installations of Matplotlib. Proceed with caution because these instructions
142+
may result in your build producing unexpected behavior and/or causing
143+
local testing to fail.
144+
145+
If you would like to build from a tarball, grab the latest *tar.gz* release
146+
file from `the PyPI files page <https://pypi.org/project/matplotlib/>`_.
147+
148+
We provide a `mplsetup.cfg`_ file which you can use to customize the build
149+
process. For example, which default backend to use, whether some of the
150+
optional libraries that Matplotlib ships with are installed, and so on. This
151+
file will be particularly useful to those packaging Matplotlib.
152+
153+
.. _mplsetup.cfg: https://raw.githubusercontent.com/matplotlib/matplotlib/main/mplsetup.cfg.template
154+
155+
If you are building your own Matplotlib wheels (or sdists) on Windows, note
156+
that any DLLs that you copy into the source tree will be packaged too.
157+
158+
==========================
159+
Installing for development
160+
==========================
161+
See :ref:`installing_for_devs`.
2162

3163
.. redirect-from:: /faq/installing_faq
164+
.. redirect-from:: /users/faq/installing_faq
165+
166+
.. _installing-faq:
4167

5-
**************
6-
Installing FAQ
7-
**************
168+
==========================
169+
Frequently Asked Questions
170+
==========================
8171

9172
.. contents::
10173
:backlinks: none
174+
:local:
11175

12176
Report a compilation problem
13177
============================

doc/users/installing/index.rst

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)