diff --git a/INSTALL.rst b/INSTALL.rst index 2c65af70c100..e798e1fedf39 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -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 @@ -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 ` build of Python. - Test Data --------- @@ -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 `_, Pillow, MiKTeX, GhostScript, ffmpeg, avconv, ImageMagick, and `Inkscape `_; * run ``pytest path\to\tests\directory``. - Third-party distributions of Matplotlib ======================================= @@ -75,7 +72,6 @@ Linux platforms. `WinPython `__ 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 ---------------------------------- @@ -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 @@ -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 `_ (>= 3.5) * `NumPy `_ (>= |minimum_numpy_version|) @@ -179,11 +173,10 @@ etc., you can install the following: .. note:: - Matplotlib depends on a large number of non-Python libraries. - `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 + `__ 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:: @@ -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 @@ -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 `_. - There are a few possibilities to build Matplotlib on Windows: * Wheels via `matplotlib-winbuild `_ @@ -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 `_ -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...) @@ -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 -`_ -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. diff --git a/build_alllocal.cmd b/build_alllocal.cmd index dbda9149a3c1..56e2968a195f 100644 --- a/build_alllocal.cmd +++ b/build_alllocal.cmd @@ -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