10000 Cleanup installing docs · matplotlib/matplotlib@7ddb06a · GitHub
[go: up one dir, main page]

Skip to content

Commit 7ddb06a

Browse files
committed
Cleanup installing docs
1 parent c2946de commit 7ddb06a

File tree

2 files changed

+128
-100
lines changed

2 files changed

+128
-100
lines changed

INSTALL.rst

Lines changed: 46 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
==================
2-
Installation Guide
3-
==================
1+
############
2+
Installation
3+
############
44

5-
.. note::
5+
.. toctree::
6+
:hidden:
67

7-
If you wish to contribute to the project, it's recommended you
8-
:ref:`install the latest development version<install_from_source>`.
8+
installing_source.rst
99

10-
.. contents::
1110

11+
==============================
1212
Installing an official release
1313
==============================
1414

15-
Matplotlib and its dependencies are available as wheel packages for macOS,
16-
Windows and Linux distributions::
15+
Matplotlib releases are available as wheel packages for macOS, Windows and
16+
Linux on `PyPI <https://pypi.org/project/matplotlib/>`_. Install it using
17+
``pip``::
1718

1819
python -m pip install -U pip
1920
python -m pip install -U matplotlib
@@ -35,113 +36,58 @@ precompiled wheel for your OS and Python.
3536
install :ref:`optional_dependencies`.
3637

3738
Although not required, we suggest also installing ``IPython`` for
38-
interactive use. To easily install a complete Scientific Python
39-
stack, see :ref:`install_scipy_dists` below.
40-
41-
Third-party distributions of Matplotlib
42-
=======================================
43-
44-
.. _install_scipy_dists:
39+
interactive use.
4540

46-
Scientific Python Distributions
47-
-------------------------------
41+
=========================
42+
Third-party distributions
43+
=========================
4844

49-
`Anaconda <https://www.anaconda.com/>`_ and `ActiveState
50-
<https://www.activestate.com/activepython/downloads>`_ are excellent
51-
choices that "just work" out of the box for Windows, macOS and common
52-
Linux platforms. `WinPython <https://winpython.github.io/>`_ is an
53-
option for Windows users. All of these distributions include
54-
Matplotlib and *lots* of other useful (data) science tools.
55-
56-
Linux: using your package manager
57-
---------------------------------
58-
59-
If you are on Linux, you might prefer to use your package manager. Matplotlib
60-
is packaged for almost every major Linux distribution.
61-
62-
* Debian / Ubuntu: ``sudo apt-get install python3-matplotlib``
63-
* Fedora: ``sudo dnf install python3-matplotlib``
64-
* Red Hat: ``sudo yum install python3-matplotlib``
65-
* Arch: ``sudo pacman -S python-matplotlib``
66-
67-
.. _install_from_source:
68-
69-
Installing from source
70-
======================
45+
Various third-parties provide Matplotlib for their environements.
7146

72-
If you are interested in contributing to Matplotlib development,
73-
running the latest source code, or just like to build everything
74-
yourself, it is not difficult to build Matplotlib from source.
47+
Conda packages
48+
==============
49+
Matplotlib is available both via the *anconda main channel*
7550

76-
First you need to install the :ref:`dependencies`.
51+
.. code-block:: sh
7752
78-
A C compiler is required. Typically, on Linux, you will need ``gcc``, which
79-
should be installed using your distribution's package manager; on macOS, you
80-
will need xcode_; on Windows, you will need Visual Studio 2015 or later.
53+
conda install matplotlib
8154
82-
.. _xcode: https://guide.macports.org/chunked/installing.html#installing.xcode
55+
as well as via the *conda-forge community channel*
8356

84-
The easiest way to get the latest development version to start contributing
85-
is to go to the git `repository <https://github.com/matplotlib/matplotlib>`_
86-
and run::
57+
.. code-block:: sh
8758
88-
git clone https://github.com/matplotlib/matplotlib.git
89-
90-
or::
59+
conda install -c conda-forge matplotlib
9160
92-
git clone git@github.com:matplotlib/matplotlib.git
61+
Python distributions
62+
====================
9363

94-
If you're developing, it's better to do it in editable mode. The reason why
95-
is that pytest's test discovery only works for Matplotlib
96-
if installation is done this way. Also, editable mode allows your code changes
97-
to be instantly propagated to your library code without reinstalling (though
98-
you will have to restart your python process / kernel)::
64+
Matplotlib is part of major Python distributions:
9965

100-
cd matplotlib
101-
python -m pip install -e .
66+
- `Anaconda <https://www.anaconda.com/>`_
10267

103-
If you're not developing, it can be installed from the source directory with
104-
a simple (just replace the last step)::
68+
- `ActiveState ActivePython
69+
<https://www.activestate.com/activepython/downloads>`_
10570

106-
python -m pip install .
71+
- `WinPython <https://winpython.github.io/>`_
10772

108-
To run the tests you will need to install some additional dependencies::
73+
Linux package manager
74+
=====================
10975

110-
python -m pip install -r requirements/dev/dev-requirements.txt
111-
112-
Then, if you want to update your Matplotlib at any time, just do::
76+
If you are using the Python version in your Linux distribution, you can install
77+
Matplotlib via your package manager:
11378

114-
git pull
115-
116-
When you run ``git pull``, if the output shows that only Python files have
117-
been updated, you are all set. If C files have changed, you need to run ``pip
118-
install -e .`` again to compile them.
119-
120-
There is more information on :ref:`using git <using-git>` in the developer
121-
docs.
122-
123-
.. warning::
124-
125-
The following instructions in this section are for very custom
126-
installations of Matplotlib. Proceed with caution because these instructions
127-
may result in your build producing unexpected behavior and/or causing
128-
local testing to fail.
129-
130-
If you would like to build from a tarball, grab the latest *tar.gz* release
131-
file from `the PyPI files page <https://pypi.org/project/matplotlib/>`_.
132-
133-
We provide a `setup.cfg`_ file which you can use to customize the build
134-
process. For example, which default backend to use, whether some of the
135-
optional libraries that Matplotlib ships with are installed, and so on. This
136-
file will be particularly useful to those packaging Matplotlib.
137-
138-
.. _setup.cfg: https://raw.githubusercontent.com/matplotlib/matplotlib/master/setup.cfg.template
79+
* Debian / Ubuntu: ``sudo apt-get install python3-matplotlib``
80+
* Fedora: ``sudo dnf install python3-matplotlib``
81+
* Red Hat: ``sudo yum install python3-matplotlib``
82+
* Arch: ``sudo pacman -S python-matplotlib``
13983

140-
Building on Windows
141-
-------------------
84+
======================
85+
Installing from source
86+
======================
87+
See :ref:`install_from_source`.
14288

143-
Compiling Matplotlib (or any other extension module, for that matter) requires
144-
Visual Studio 2015 or later.
89+
==========================
90+
Installing for development
91+
==========================
92+
See :ref:`installing_for_devs`.
14593

146-
If you are building your own Matplotlib wheels (or sdists), note that any DLLs
147-
that you copy into the source tree will be packaged too.

doc/users/installing_source.rst

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
.. _install_from_source:
2+
3+
======================
4+
Installing from source
5+
======================
6+
7+
If you are interested in contributing to Matplotlib development,
8+
running the latest source code, or just like to build everything
9+
yourself, it is not difficult to build Matplotlib from source.
10+
11+
First you need to install the :ref:`dependencies`.
12+
13+
A C compiler is required. Typically, on Linux, you will need ``gcc``, which
14+
should be installed using your distribution's package manager; on macOS, you
15+
will need xcode_; on Windows, you will need Visual Studio 2015 or later.
16+
17+
.. _xcode: https://guide.macports.org/chunked/installing.html#installing.xcode
18+
19+
The easiest way to get the latest development version to start contributing
20+
is to go to the git `repository <https://github.com/matplotlib/matplotlib>`_
21+
and run::
22+
23+
git clone https://github.com/matplotlib/matplotlib.git
24+
25+
or::
26+
27+
git clone git@github.com:matplotlib/matplotlib.git
28+
29+
If you're developing, it's better to do it in editable mode. The reason why
30+
is that pytest's test discovery only works for Matplotlib
31+
if installation is done this way. Also, editable mode allows your code changes
32+
to be instantly propagated to your library code without reinstalling (though
33+
you will have to restart your python process / kernel)::
34+
35+
cd matplotlib
36+
python -m pip install -e .
37+
38+
If you're not developing, it can be installed from the source directory with
39+
a simple (just replace the last step)::
40+
41+
python -m pip install .
42+
43+
To run the tests you will need to install some additional dependencies::
44+
45+
python -m pip install -r requirements/dev/dev-requirements.txt
46+
47+
Then, if you want to update your Matplotlib at any time, just do::
48+
49+
git pull
50+
51+
When you run ``git pull``, if the output shows that only Python files have
52+
been updated, you are all set. If C files have changed, you need to run ``pip
53+
install -e .`` again to compile them.
54+
55+
There is more information on :ref:`using git <using-git>` in the developer
56+
docs.
57+
58+
.. warning::
59+
60+
The following instructions in this section are for very custom
61+
installations of Matplotlib. Proceed with caution because these instructions
62+
may result in your build producing unexpected behavior and/or causing
63+
local testing to fail.
64+
65+
If you would like to build from a tarball, grab the latest *tar.gz* release
66+
file from `the PyPI files page <https://pypi.org/project/matplotlib/>`_.
67+
68+
We provide a `setup.cfg`_ file which you can use to customize the build
69+
process. For example, which default backend to use, whether some of the
70+
optional libraries that Matplotlib ships with are installed, and so on. This
71+
file will be particularly useful to those packaging Matplotlib.
72+
73+
.. _setup.cfg: https://raw.githubusercontent.com/matplotlib/matplotlib/master/setup.cfg.template
74+
75+
Building on Windows
76+
-------------------
77+
78+
Compiling Matplotlib (or any other extension module, for that matter) requires
79+
Visual Studio 2015 or later.
80+
81+
If you are building your own Matplotlib wheels (or sdists), note that any DLLs
82+
that you copy into the source tree will be packaged too.

0 commit comments

Comments
 (0)
0