8000 Update INSTALL.rst. by anntzer · Pull Request #10896 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Update INSTALL.rst. #10896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 20 additions & 47 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Installing
Installing an official release
==============================

Matplotlib and most of its dependencies are all available as wheel
packages for macOS, Windows and Linux distributions::
Matplotlib and its dependencies are available as wheel packages for macOS,
Windows and Linux distributions::

python -mpip install -U pip
python -mpip install -U matplotlib
Expand All @@ -32,14 +32,12 @@ Although not required, we suggest also installing ``IPython`` for
interactive use. To easily install a complete Scientific Python
stack, see :ref:`install_scipy_dists` below.


macOS
-----

To use the native OSX backend you will need :ref:`a framework build
<osxframework-faq>` build of Python.


Test Data
---------

Expand All @@ -51,14 +49,13 @@ distribution, download the :file:`*.tar.gz` file and look in the
:file:`examples` subdirectory.
To run the test suite:

* extract the :file:`lib\\matplotlib\\tests` or
:file:`lib\\mpl_toolkits\\tests` directories from the source distribution;
* extract the :file:`lib/matplotlib/tests` or
:file:`lib/mpl_toolkits/tests` directories from the source distribution;
* install test dependencies: `pytest <https://pypi.python.org/pypi/pytest>`_,
Pillow, MiKTeX, GhostScript, ffmpeg, avconv, ImageMagick, and `Inkscape
<https://inkscape.org/>`_;
* run ``pytest path\to\tests\directory``.


Third-party distributions of Matplotlib
=======================================

Expand All @@ -75,7 +72,6 @@ Linux platforms. `WinPython <https://winpython.github.io/>`__ is an
option for windows users. All of these distributions include
Matplotlib and *lots* of other useful (data) science tools.


Linux : using your package manager
----------------------------------

Expand All @@ -87,8 +83,6 @@ is packaged for almost every major Linux distribution.
* Red Hat: ``sudo yum install python3-matplotlib``
* Arch: ``sudo pacman -S python-matplotlib``



.. _install_from_source:

Installing from source
Expand Down Expand Up @@ -137,7 +131,7 @@ e.g., if the header of some required library is in
Dependencies
------------

Matplotlib requires a large number of dependencies:
Matplotlib requires the following dependencies:

* `Python <https://www.python.org/downloads/>`_ (>= 3.5)
* `NumPy <http://www.numpy.org>`_ (>= |minimum_numpy_version|)
Expand Down Expand Up @@ -179,11 +173,10 @@ etc., you can install the following:

.. note::

Matplotlib depends on a large number of non-Python libraries.
`pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config/>`__
can be used to find required non-Python libraries and thus make the install
go more smoothly if the libraries and headers are not in the expected
locations.
Matplotlib depends on non-Python libraries. `pkg-config
<https://www.freedesktop.org/wiki/Software/pkg-config/>`__ can be used
to find required non-Python libraries and thus make the install go more
smoothly if the libraries and headers are not in the expected locations.

.. note::

Expand Down Expand Up @@ -218,7 +211,6 @@ Matplotlib by first installing ``yum-builddep`` and then running::
These commands do not build Matplotlib, but instead get and install the
build dependencies, which will make building from source easier.


.. _build_osx:

Building on macOS
Expand Down Expand Up @@ -250,22 +242,21 @@ found that, to run the tests, their PYTHONPATH must include
/path/to/anaconda/.../site-packages and their DYLD_FALLBACK_LIBRARY_PATH
must include /path/to/anaconda/lib.


.. _build_windows:

Building on Windows
-------------------

The Python shipped from https://www.python.org is compiled with Visual Studio
2008 for versions before 3.3, Visual Studio 2010 for 3.3 and 3.4, and
Visual Studio 2015 for 3.5 and 3.6. Python extensions are recommended to be compiled
with the same compiler.
2015 for 3.5 and 3.6. Python extensions should be compiled with the same
compiler, see e.g.
https://packaging.python.org/guides/packaging-binary-extensions/#setting-up-a-build-environment-on-windows
for how to set up a build environment.

Since there is no canonical Windows package manager, the methods for building
FreeType, zlib, and libpng from source code are documented as a build script
at `matplotlib-winbuild <https://github.com/jbmohler/matplotlib-winbuild>`_.


There are a few possibilities to build Matplotlib on Windows:

* Wheels via `matplotlib-winbuild <https://github.com/jbmohler/matplotlib-winbuild>`_
Expand All @@ -275,17 +266,14 @@ There are a few possibilities to build Matplotlib on Windows:
Wheel builds using conda packages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is a wheel build, but we use conda packages to get all the requirements. The binary
requirements (png, FreeType,...) are statically linked and therefore not needed during the wheel
install.
This is a wheel build, but we use conda packages to get all the requirements.
The binary requirements (png, FreeType,...) are statically linked and therefore
not needed during the wheel install.

The commands below assume that you can compile a native Python lib for the Python version of your
choice. See `this howto <https://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/>`_
for how to install and setup such environments. If in doubt: use Python >= 3.5 as it mostly works
without fiddling with environment variables::
::

# create a new environment with the required packages
conda create -n "matplotlib_build" python=3.5 numpy python-dateutil pyparsing pytz tornado "cycler>=0.10" tk libpng zlib freetype
conda create -n "matplotlib_build" python=3.5 numpy python-dateutil pyparsing pytz tornado cycler tk libpng zlib freetype
activate matplotlib_build
# if you want a qt backend, you also have to install pyqt (be aware that pyqt doesn't mix well if
# you have created the environment with conda-forge already activated...)
Expand All @@ -309,23 +297,8 @@ without fiddling with environment variables::
The `build_alllocal.cmd` script in the root folder automates these steps if
you have already created and activated the conda environment.


Conda packages
^^^^^^^^^^^^^^

This needs a `working installed C compiler
<https://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/>`_
for the version of Python you are compiling the package for but you don't need
to setup the environment variables::

# only the first time...
conda install conda-build

# the Python version you want a package for...
set CONDA_PY=3.5

# builds the package, using a clean build environment
conda build ci\conda_recipe

# install the new package
conda install --use-local matplotlib
The conda packaging scripts for Matplotlib are available at
https://github.com/conda-forge/python-feedstock.
2 changes: 1 addition & 1 deletion build_alllocal.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:: This assumes you have installed all the dependencies via conda packages:
:: # create a new environment with the required packages
:: conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado "cycler>=0.10" tk libpng zlib freetype
:: conda create -n "matplotlib_build" python=3.5 numpy python-dateutil pyparsing pytz tornado cycler tk libpng zlib freetype
:: activate matplotlib_build
:: if you want qt backend, you also have to install pyqt
:: conda install pyqt
Expand Down
0