Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e867aae

Browse filesBrowse files
committed
Update installation faq.
1 parent 3b52f44 commit e867aae
Copy full SHA for e867aae

File tree

Expand file treeCollapse file tree

1 file changed

+94
-172
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+94
-172
lines changed

‎doc/faq/installing_faq.rst

Copy file name to clipboardExpand all lines: doc/faq/installing_faq.rst
+94-172Lines changed: 94 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,10 @@ The first thing to try is a :ref:`clean install <clean-install>` and see if
1919
that helps. If not, the best way to test your install is by running a script,
2020
rather than working interactively from a python shell or an integrated
2121
development environment such as :program:`IDLE` which add additional
22-
complexities. Open up a UNIX shell or a DOS command prompt and cd into a
23-
directory containing a minimal example in a file. Something like
24-
:file:`simple_plot.py` for example::
22+
complexities. Open up a UNIX shell or a DOS command prompt and run, for
23+
example::
2524

26-
import matplotlib.pyplot as plt
27-
fig, ax = plt.subplots()
28-
ax.plot([1,2,3])
29-
plt.show()
30-
31-
and run it with::
32-
33-
python simple_plot.py --verbose-helpful
25+
python -c "from pylab import *; plot(); show()" --verbose-helpful
3426

3527
This will give you additional information about which backends matplotlib is
3628
loading, version information, and more. At this point you might want to make
@@ -42,127 +34,46 @@ If you are still having trouble, see :ref:`reporting-problems`.
4234

4335
.. _clean-install:
4436

45-
How to completely remove matplotlib
37+
How to completely remove Matplotlib
4638
===================================
4739

48-
Occasionally, problems with matplotlib can be solved with a clean
49-
installation of the package.
50-
51-
The process for removing an installation of matplotlib depends on how
52-
matplotlib was originally installed on your system. Follow the steps
53-
below that goes with your original installation method to cleanly
54-
remove matplotlib from your system.
55-
56-
Source install
57-
--------------
58-
59-
Unfortunately::
60-
61-
python setup.py clean
40+
Occasionally, problems with Matplotlib can be solved with a clean
41+
installation of the package. In order to fully remove an installed Matplotlib:
6242

63-
does not properly clean the build directory, and does nothing to the
64-
install directory. To cleanly rebuild:
65-
66-
1. Delete the caches from your :ref:`.matplotlib configuration directory
43+
1. Delete the caches from your :ref:`Matplotlib configuration directory
6744
<locating-matplotlib-config-dir>`.
6845

69-
2. Delete the ``build`` directory in the source tree.
70-
71-
3. Delete any matplotlib directories or eggs from your :ref:`installation
46+
2. Delete any Matplotlib directories or eggs from your :ref:`installation
7247
directory <locating-matplotlib-install>`.
7348

74-
How to Install
75-
==============
76-
77-
.. _install-from-git:
78-
79-
Source install from git
80-
-----------------------
81-
82-
Clone the main source using one of::
83-
84-
git clone git@github.com:matplotlib/matplotlib.git
85-
86-
or::
87-
88-
git clone git://github.com/matplotlib/matplotlib.git
89-
90-
and build and install as usual with::
91-
92-
> cd matplotlib
93-
> python setup.py install
94-
95-
.. note::
96-
97-
If you are on debian/ubuntu, you can get all the dependencies
98-
required to build matplotlib with::
99-
100-
sudo apt-get build-dep python-matplotlib
101-
102-
If you are on Fedora/RedHat, you can get all the dependencies
103-
required to build matplotlib by first installing ``yum-builddep``
104-
and then running::
105-
106-
su -c "yum-builddep python-matplotlib"
107-
108-
This does not build matplotlib, but it does get all of the
109-
build dependencies, which will make building from source easier.
110-
111-
112-
If you want to be able to follow the development branch as it changes
113-
just replace the last step with (make sure you have **setuptools**
114-
installed)::
115-
116-
> python setup.py develop
117-
118-
This creates links in the right places and installs the command
119-
line script to the appropriate places.
120-
121-
.. note::
122-
Mac OSX users please see the :ref:`build_osx` guide.
123-
124-
Windows users please see the :ref:`build_windows` guide.
125-
126-
Then, if you want to update your matplotlib at any time, just do::
127-
128-
> git pull
129-
130-
When you run `git pull`, if the output shows that only Python files have been
131-
updated, you are all set. If C files have changed, you need to run the `python
132-
setup.py develop` command again to compile them.
133-
134-
There is more information on :ref:`using git <using-git>` in
135-
the developer docs.
136-
137-
13849
Linux Notes
13950
===========
14051

141-
Because most Linux distributions use some sort of package manager,
142-
we do not provide a pre-built binary for the Linux platform.
143-
Instead, we recommend that you use the "Add Software" method for
144-
your system to install matplotlib. This will guarantee that everything
145-
that is needed for matplotlib will be installed as well.
52+
We recommend that you use your distribution's package manager to install
53+
Matplotlib. This will guarantee that Matplotlib's dependencies will be
54+
installed as well.
55+
56+
If, for some reason, you can not use the package manager, you may use the
57+
manylinux wheels available on PyPI::
14658

147-
If, for some reason, you can not use the package manager, Linux usually
148-
comes with at least a basic build system. Follow the :ref:`instructions
149-
<install-from-git>` found above for how to build and install matplotlib.
59+
python -mpip install matplotlib
15060

61+
or :ref:`build Matplotlib from source <install-from-git>`.
15162

152-
OS-X Notes
153-
==========
63+
OSX Notes
64+
=========
15465

15566
.. _which-python-for-osx:
15667

157-
Which python for OS X?
158-
----------------------
68+
Which python for OSX?
69+
---------------------
15970

160-
Apple ships OS X with its own Python, in ``/usr/bin/python``, and its own copy
161-
of matplotlib. Unfortunately, the way Apple currently installs its own copies
162-
of numpy, scipy and matplotlib means that these packages are difficult to
71+
Apple ships OSX with its own Python, in ``/usr/bin/python``, and its own copy
72+
of Matplotlib. Unfortunately, the way Apple currently installs its own copies
73+
of NumPy, Scipy and Matplotlib means that these packages are difficult to
16374
upgrade (see `system python packages`_). For that reason we strongly suggest
16475
that you install a fresh version of Python and use that as the basis for
165-
installing libraries such as numpy and matplotlib. One convenient way to
76+
installing libraries such as NumPy and Matplotlib. One convenient way to
16677
install matplotlib with other useful Python software is to use one of the
16778
excellent Python scientific software collections that are now available:
16879

@@ -242,20 +153,15 @@ For Python 2.7::
242153

243154
pip2 install matplotlib
244155

245-
For Python 3.4::
156+
For Python 3::
246157

247158
pip3 install matplotlib
248159

249-
You might also want to install IPython; we recommend you install IPython with
250-
the IPython notebook option, like this:
160+
You might also want to install IPython or the Jupyter notebook (``pip install
161+
ipython``, ``pip install notebook``; for Macports and Homebrew, adapt the
162+
command as above).
251163

252-
* Python.org Python: ``pip install ipython[notebook]``
253-
* Macports ``sudo pip-2.7 install ipython[notebook]`` or ``sudo pip-3.4
254-
install ipython[notebook]``
255-
* Homebrew ``pip2 install ipython[notebook]`` or ``pip3 install
256-
ipython[notebook]``
257-
258-
Pip problems
164+
pip problems
259165
^^^^^^^^^^^^
260166

261167
If you get errors with pip trying to run a compiler like ``gcc`` or ``clang``,
@@ -264,51 +170,10 @@ then the first thing to try is to `install xcode
264170
retry the install. If that does not work, then check
265171
:ref:`reporting-problems`.
266172

267-
Installing via OSX mpkg installer package
268-
-----------------------------------------
269-
270-
matplotlib also has a disk image (``.dmg``) installer, which contains a
271-
typical Installer.app package to install matplotlib. You should use binary
272-
wheels instead of the disk image installer if you can, because:
273-
274-
* wheels work with Python.org Python, homebrew and macports, the disk image
275-
installer only works with Python.org Python.
276-
* The disk image installer doesn't check for recent versions of packages that
277-
matplotlib depends on, and unconditionally installs the versions of
278-
dependencies contained in the disk image installer. This can overwrite
279-
packages that you have already installed, which might cause problems for
280-
other packages, if you have a pre-existing Python.org setup on your
281-
computer.
282-
283-
If you still want to use the disk image installer, read on.
284-
285-
.. note::
286-
Before installing via the disk image installer, be sure that all of the
287-
packages were compiled for the same version of python. Often, the download
288-
site for NumPy and matplotlib will display a supposed 'current' version of
289-
the package, but you may need to choose a different package from the full
290-
list that was built for your combination of python and OSX.
291-
292-
The disk image installer will have a ``.dmg`` extension, and will have a name
293-
like :file:`matplotlib-1.4.0-py2.7-macosx10.6.dmg`.
294-
The name of the installer depends on the versions of python and matplotlib it
295-
was built for, and the version of OSX that the matching Python.org installer
296-
was built for. For example, if the mathing Python.org Python installer was
297-
built for OSX 10.6 or greater, the dmg file will end in ``-macosx10.6.dmg``.
298-
You need to download this disk image file, open the disk image file by double
299-
clicking, and find the new matplotlib disk image icon on your desktop. Double
300-
click on that icon to show the contents of the image. Then double-click on
301-
the ``.mpkg`` icon, which will have a name like
302-
:file:`matplotlib-1.4.0-py2.7-macosx10.6.mpkg`, it will run the Installer.app,
303-
prompt you for a password if you need system-wide installation privileges, and
304-
install to a directory like
305-
:file:`/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages`
306-
(exact path depends on your Python version).
307-
308173
Checking your installation
309174
--------------------------
310175

311-
The new version of matplotlib should now be on your Python "path". Check this
176+
The new version of Matplotlib should now be on your Python "path". Check this
312177
with one of these commands at the Terminal.app command line::
313178

314179
python2.7 -c 'import matplotlib; print matplotlib.__version__, matplotlib.__file__'
@@ -321,7 +186,7 @@ with one of these commands at the Terminal.app command line::
321186

322187
1.4.0 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/__init__.pyc
323188

324-
where ``1.4.0`` is the matplotlib version you just installed, and the path
189+
where ``1.4.0`` is the Matplotlib version you just installed, and the path
325190
following depends on whether you are using Python.org Python, Homebrew or
326191
Macports. If you see another version, or you get an error like this::
327192

@@ -340,14 +205,71 @@ or::
340205

341206
If you get the result ``/usr/bin/python2.7``, then you are getting the Python
342207
installed with OSX, which is probably not what you want. Try closing and
343-
restarting Terminal.app before running the check again. If that doesn't fix
344-
the problem, depending on which Python you wanted to use, consider
345-
reinstalling Python.org Python, or check your homebrew or macports setup.
346-
Remember that the disk image installer only works for Python.org Python, and
347-
will not get picked up by other Pythons. If all these fail, please let us
348-
know: see :ref:`reporting-problems`.
208+
restarting Terminal.app before running the check again. If that doesn't fix the
209+
problem, depending on which Python you wanted to use, consider reinstalling
210+
Python.org Python, or check your homebrew or macports setup. Remember that
211+
the disk image installer only works for Python.org Python, and will not get
212+
picked up by other Pythons. If all these fail, please :ref:`let us know
213+
<reporting-problems>`.
349214

350215
Windows Notes
351216
=============
352217

353218
See :ref:`installing_windows`.
219+
220+
.. _install-from-git:
221+
222+
Install from source
223+
===================
224+
225+
Clone the main source using one of::
226+
227+
git clone git@github.com:matplotlib/matplotlib.git
228+
229+
or::
230+
231+
git clone git://github.com/matplotlib/matplotlib.git
232+
233+
and build and install as usual with::
234+
235+
cd matplotlib
236+
pip install .
237+
238+
.. note::
239+
240+
If you are on Debian/Ubuntu, you can get all the dependencies required to
241+
build Matplotlib with::
242+
243+
sudo apt-get build-dep python-matplotlib
244+
245+
If you are on Fedora/RedHat, you can get all the dependencies required to
246+
build matplotlib by first installing ``yum-builddep`` and then running::
247+
248+
su -c 'yum-builddep python-matplotlib'
249+
250+
This does not build Matplotlib, but it does get all of the build
251+
dependencies, which will make building from source easier.
252+
253+
If you want to be able to follow the development branch as it changes
254+
just replace the last step with::
255+
256+
pip install -e .
257+
258+
This creates links and installs the command line script in the appropriate
259+
places.
260+
261+
.. note::
262+
OSX users please see the :ref:`build_osx` guide.
263+
264+
Windows users please see the :ref:`build_windows` guide.
265+
266+
Then, if you want to update your matplotlib at any time, just do::
267+
268+
git pull
269+
270+
When you run ``git pull``, if the output shows that only Python files have
271+
been updated, you are all set. If C files have changed, you need to run ``pip
272+
install -e .`` again to compile them.
273+
274+
There is more information on :ref:`using git <using-git>` in the developer
275+
docs.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.