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

Skip to content

Commit a9a495e

Browse files
authored
Merge pull request #10896 from anntzer/update-installrst
Update INSTALL.rst.
2 parents 8effa93 + b55bd68 commit a9a495e

File tree

2 files changed

+21
-48
lines changed

2 files changed

+21
-48
lines changed

INSTALL.rst

Lines changed: 20 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Installing
1414
Installing an official release
1515
==============================
1616

17-
Matplotlib and most of its dependencies are all available as wheel
18-
packages for macOS, Windows and Linux distributions::
17+
Matplotlib and its dependencies are available as wheel packages for macOS,
18+
Windows and Linux distributions::
1919

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

35-
3635
macOS
3736
-----
3837

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

42-
4341
Test Data
4442
---------
4543

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

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

61-
6259
Third-party distributions of Matplotlib
6360
=======================================
6461

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

78-
7975
Linux : using your package manager
8076
----------------------------------
8177

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

90-
91-
9286
.. _install_from_source:
9387

9488
Installing from source
@@ -137,7 +131,7 @@ e.g., if the header of some required library is in
137131
Dependencies
138132
------------
139133

140-
Matplotlib requires a large number of dependencies:
134+
Matplotlib requires the following dependencies:
141135

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

180174
.. note::
181175

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

188181
.. note::
189182

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

221-
222214
.. _build_osx:
223215

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

253-
254245
.. _build_windows:
255246

256247
Building on Windows
257248
-------------------
258249

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

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

268-
269260
There are a few possibilities to build Matplotlib on Windows:
270261

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

278-
This is a wheel build, but we use conda packages to get all the requirements. The binary
279-
requirements (png, FreeType,...) are statically linked and therefore not needed during the wheel
280-
install.
269+
This is a wheel build, but we use conda packages to get all the requirements.
270+
The binary requirements (png, FreeType,...) are statically linked and therefore
271+
not needed during the wheel install.
281272

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

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

312-
313300
Conda packages
314301
^^^^^^^^^^^^^^
315302

316-
This needs a `working installed C compiler
317-
<https://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/>`_
318-
for the version of Python you are compiling the package for but you don't need
319-
to setup the environment variables::
320-
321-
# only the first time...
322-
conda install conda-build
323-
324-
# the Python version you want a package for...
325-
set CONDA_PY=3.5
326-
327-
# builds the package, using a clean build environment
328-
conda build ci\conda_recipe
329-
330-
# install the new package
331-
conda install --use-local matplotlib
303+
The conda packaging scripts for Matplotlib are available at
304+
https://github.com/conda-forge/python-feedstock.

build_alllocal.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
:: This assumes you have installed all the dependencies via conda packages:
22
:: # create a new environment with the required packages
3-
:: conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado "cycler>=0.10" tk libpng zlib freetype
3+
:: conda create -n "matplotlib_build" python=3.5 numpy python-dateutil pyparsing pytz tornado cycler tk libpng zlib freetype
44
:: activate matplotlib_build
55
:: if you want qt backend, you also have to install pyqt
66
:: conda install pyqt

0 commit comments

Comments
 (0)