diff --git a/INSTALL b/INSTALL deleted file mode 100644 index e176a8bac16f..000000000000 --- a/INSTALL +++ /dev/null @@ -1,343 +0,0 @@ -.. The source of this document is INSTALL. During the doc build process, -.. this file is copied over to doc/users/installing.rst. -.. Therefore, you must edit INSTALL, *not* doc/users/installing.rst! -.. _pip: https://pypi.python.org/pypi/pip/ - -********** -Installing -********** - -There are many different ways to install matplotlib, and the best way -depends on what operating system you are using, what you already have -installed, and how you want to use it. To avoid wading through all -the details (and potential complications) on this page, there are several -convenient options. - -Installing pre-built packages -============================= - -Most platforms : scientific Python distributions ------------------------------------------------- - -The first option is to use one of the pre-packaged python -distributions that already provide matplotlib built-in. The -Continuum.io Python distribution (`Anaconda -`_ or `miniconda -`_) and the Enthought -distribution `(Canopy) `_ -are both excellent choices that "just work" out of the box for -Windows, OSX and common Linux platforms. Both of these distributions -include matplotlib and *lots* of other useful tools. - - -Linux : using your package manager ----------------------------------- - -If you are on Linux, you might prefer to use your package manager. matplotlib -is packaged for almost every major Linux distribution. - -* Debian / Ubuntu : ``sudo apt-get install python-matplotlib`` -* Fedora / Redhat : ``sudo yum install python-matplotlib`` - -Mac OSX : using pip -------------------- - -If you are on Mac OSX you can probably install matplotlib binaries using the -standard Python installation program pip_. -See :ref:`install_osx_binaries`. - -.. _installing_windows: - -Windows -------- - -If you don't already have Python installed, we recommend using -one of the `scipy-stack compatible Python distributions -`_ such as WinPython, Python(x,y), -Enthought Canopy, or Continuum Anaconda, which have matplotlib and many -of its dependencies, plus other useful packages, preinstalled. - -For `standard Python `_ installations, -install matplotlib using pip_:: - - python -m pip install -U pip setuptools - python -m pip install matplotlib - -In case Python 2.7 or 3.4 are not installed for all users, -the Microsoft Visual C++ 2008 -(`64 bit `__ -or -`32 bit `__ -for Python 2.7) or Microsoft Visual C++ 2010 -(`64 bit `__ -or -`32 bit `__ -for Python 3.4) redistributable packages need to be installed. - -Matplotlib depends on `Pillow `_ -for reading and saving JPEG, BMP, and TIFF image files. -Matplotlib requires `MiKTeX `_ and -`GhostScript `_ for rendering text -with LaTeX. -`FFmpeg `_, `avconv `_, -`mencoder `_, or -`ImageMagick `_ are required for the -animation module. - -The following backends should work out of the box: agg, tkagg, ps, -pdf and svg. -For other backends you may need to install -`pycairo `_, -`PyQt4 `_, -`PyQt5 `_, -`PySide `_, -`wxPython `_, -`PyGTK `_, -`Tornado `_, -or GhostScript. - -TkAgg is probably the best backend for interactive use from the -standard Python shell or IPython. It is enabled as the default backend -for the official binaries. GTK3 is not supported on Windows. - -The Windows wheels (:file:`*.whl`) on the `PyPI download page -`_ do not contain test data -or example code. -If you want to try the many demos that come in the matplotlib source -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; - * install test dependencies: `pytest `_, - `mock `_, Pillow, MiKTeX, GhostScript, - ffmpeg, avconv, mencoder, ImageMagick, and `Inkscape - `_; - * run ``py.test path\\to\\tests\\directory``. - - - -.. _install_from_source: - -Installing from source -====================== - -If you are interested in contributing to matplotlib development, -running the latest source code, or just like to build everything -yourself, it is not difficult to build matplotlib from source. Grab -the latest *tar.gz* release file from `the PyPI files page -`_, or if you want to -develop matplotlib or just need the latest bugfixed version, grab the -latest git version :ref:`install-from-git`. - -The standard environment variables `CC`, `CXX`, `PKG_CONFIG` are respected. -This means you can set them if your toolchain is prefixed. This may be used for -cross compiling. -:: - - export CC=x86_64-pc-linux-gnu-gcc - export CXX=x86_64-pc-linux-gnu-g++ - export PKG_CONFIG=x86_64-pc-linux-gnu-pkg-config - -Once you have satisfied the requirements detailed below (mainly -python, numpy, libpng and freetype), you can build matplotlib. -:: - - cd matplotlib - python setup.py build - python setup.py install - -We provide a `setup.cfg -`_ -file that goes with :file:`setup.py` which you can use to customize -the build process. For example, which default backend to use, whether -some of the optional libraries that matplotlib ships with are -installed, and so on. This file will be particularly useful to those -packaging matplotlib. - -If you have installed prerequisites to nonstandard places and need to -inform matplotlib where they are, edit ``setupext.py`` and add the base -dirs to the ``basedir`` dictionary entry for your ``sys.platform``. -e.g., if the header to some required library is in -``/some/path/include/someheader.h``, put ``/some/path`` in the -``basedir`` list for your platform. - -.. _install_requirements: - -Build requirements ------------------- - -These are external packages which you will need to install before -installing matplotlib. If you are building on OSX, see -:ref:`build_osx`. If you are building on Windows, see -:ref:`build_windows`. If you are installing dependencies with a -package manager on Linux, you may need to install the development -packages (look for a "-dev" postfix) in addition to the libraries -themselves. - - -Required Dependencies -^^^^^^^^^^^^^^^^^^^^^ - -:term:`python` 2.7, 3.4, 3.5 or 3.6 - `Download python `_. - -:term:`numpy` |minimum_numpy_version| (or later) - array support for python (`download numpy `_) - -`setuptools `__ - Setuptools provides extensions for python package installation. - -:term:`dateutil` 1.1 or later - Provides extensions to python datetime handling. If using pip, - easy_install or installing from source, the installer will attempt - to download and install `python_dateutil` from PyPI. - -`pyparsing `__ - Required for matplotlib's mathtext math rendering support. If - using pip, easy_install or installing from source, the installer - will attempt to download and install `pyparsing` from PyPI. - -`libpng 1.2 (or later) `__ - library for loading and saving :term:`PNG` files (`download - `__). libpng requires - zlib. - -`pytz `__ - Used to manipulate time-zone aware datetimes. - https://pypi.python.org/pypi/pytz - -:term:`FreeType` 2.3 or later - Library for reading true type font files. If using pip, easy_install or - installing from source, the installer will attempt to locate FreeType in - expected locations. If it cannot, try installing `pkg-config - `__, - a tool used to find required non-python libraries. - -`cycler `__ 0.10.0 or later - Composable cycle class used for constructing style-cycles - -`six `_ - Required for compatibility between python 2 and python 3 - - -Dependencies for python 2 -^^^^^^^^^^^^^^^^^^^^^^^^^ - -`backports.functools_lru_cache `_ - Required for compatibility if running on Python 2.7. - -`subprocess32 `_ - Optional, unix only. Backport of the subprocess standard library from 3.2+ - for Python 2.7. It provides better error messages and timeout support. - -Optional GUI framework -^^^^^^^^^^^^^^^^^^^^^^ - -These are optional packages which you may want to install to use -matplotlib with a user interface toolkit. See -:ref:`what-is-a-backend` for more details on the optional matplotlib -backends and the capabilities they provide. - -:term:`tk` 8.3 or later, not 8.6.0 or 8.6.1 - The TCL/Tk widgets library used by the TkAgg backend. - - Versions 8.6.0 and 8.6.1 are known to have issues that may result - in segfaults when closing multiple windows in the wrong order. - -:term:`pyqt` 4.4 or later - The Qt4 widgets library python wrappers for the Qt4Agg backend - -:term:`pygtk` 2.4 or later - The python wrappers for the GTK widgets library for use with the - GTK or GTKAgg backend - -:term:`wxpython` 2.8 or later - The python wrappers for the wx widgets library for use with the - WX or WXAgg backend - -Optional external programs -^^^^^^^^^^^^^^^^^^^^^^^^^^ -`ffmpeg `__/`avconv `__ or `mencoder `__ - Required for the animation module to be save out put to movie - formats. - -`ImageMagick `__ - Required for the animation module to be able to save to animated gif. - -Optional dependencies -^^^^^^^^^^^^^^^^^^^^^ - -`Pillow `__ - If Pillow is installed, matplotlib can read and write a larger - selection of image file formats. - -`pkg-config `__ - A tool used to find required non-python libraries. This is not strictly - required, but can make installation go more smoothly if the libraries and - headers are not in the expected locations. - - -Required libraries that ship with matplotlib -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -:term:`agg` 2.4 - The antigrain C++ rendering engine. matplotlib links against the - agg template source statically, so it will not affect anything on - your system outside of matplotlib. - -`qhull` 2012.1 - A library for computing Delaunay triangulations. - -`ttconv` - truetype font utility - - -.. _build_linux: - -Building on Linux ------------------ - -It is easiest to use your system package manager to install the dependencies. - -If you are on Debian/Ubuntu, you can get all the dependencies -required to build matplotlib with:: - - sudo apt-get build-dep python-matplotlib - -If you are on Fedora/RedHat, you can get all the dependencies required -to build matplotlib by first installing ``yum-builddep`` and then -running:: - - su -c "yum-builddep python-matplotlib" - -This does not build matplotlib, but it does get and install the -build dependencies, which will make building from source easier. - - -.. _build_osx: - -Building on OSX ---------------- - -The build situation on OSX is complicated by the various places one -can get the libpng and freetype requirements (darwinports, fink, -/usr/X11R6) and the different architectures (e.g., x86, ppc, universal) and -the different OSX version (e.g., 10.4 and 10.5). We recommend that you build -the way we do for the OSX release: get the source from the tarball or the -git repository and follow the instruction in :file:`README.osx`. - - -.. _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. - -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 `_. diff --git a/INSTALL.rst b/INSTALL.rst new file mode 100644 index 000000000000..245a0e9ae223 --- /dev/null +++ b/INSTALL.rst @@ -0,0 +1,355 @@ +.. The source of this document is INSTALL.rst. During the doc build process, +.. this file is copied over to doc/users/installing.rst. +.. Therefore, you must edit INSTALL.rst, *not* doc/users/installing.rst! + +.. _pip: https://pypi.python.org/pypi/pip/ + +========== +Installing +========== + +.. note:: + + If you wish to contribute to the project, it's recommended you + :ref:`install the latest development version`. + + +.. contents:: + +Installing an official release +============================== + +Matplotlib and most of its dependencies are all available as wheel packages for +macOS, Windows and Linux distributions:: + + pip install -U matplotlib + + +Third-party distributions of Matplotlib +======================================= + +Scientific Python distributions: Conda, Canopy... +------------------------------------------------- + +The first option is to use one of the pre-packaged Python distributions that +already provide Matplotlib built-in. Both `Anaconda +`_ and `Canopy +`_ are both excellent choices that +"just work" out of the box for Windows, macOS and common Linux platforms. Both +of these distributions include Matplotlib and *lots* of other useful tools. + +Linux : using your package manager +---------------------------------- + +If you are on Linux, you might prefer to use your package manager. Matplotlib +is packaged for almost every major Linux distribution. + +* Debian / Ubuntu: ``sudo apt-get install python-matplotlib`` +* Fedora: ``sudo dnf install python-matplotlib`` +* Red Hat: ``sudo yum install python-matplotlib`` +* Arch: ``sudo pacman -S python-matplotlib`` + +.. _installing_windows: + +Windows +------- + +We strongly recommend using `SciPy-stack compatible Python distributions +`_ such as WinPython, Python(x,y), +Enthought Canopy, or Continuum Anaconda, which have Matplotlib and its +dependencies, plus other useful packages, preinstalled. + +For `standard Python `_ installations, +install Matplotlib using pip_:: + + python -m pip install -U pip setuptools + python -m pip install matplotlib + +In case Python 2.7 or 3.4 are not installed for all users, +the Microsoft Visual C++ 2008 +(`64 bit `__ +or +`32 bit `__ +for Python 2.7) or Microsoft Visual C++ 2010 +(`64 bit `__ +or +`32 bit `__ +for Python 3.4) redistributable packages need to be installed. + + +The Windows wheels (:file:`*.whl`) on the `PyPI download page +`_ do not contain test data +or example code. +If you want to try the many demos that come in the Matplotlib source +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; + * install test dependencies: `pytest `_, + `mock `_, Pillow, MiKTeX, GhostScript, + ffmpeg, avconv, mencoder, ImageMagick, and `Inkscape + `_; + * run ``py.test path\to\tests\directory``. + +.. note:: + + The following backends work out of the box: Agg, TkAgg, ps, pdf and svg. + TkAgg is probably the best backend for interactive use from the standard + Python shell or from IPython and is enabled as default. + + GTK3 is not supported on Windows. + + For support for other backends, LaTeX rendering, animation input/output and + a larger selection of file formats, you may need to install :ref:`additional + dependencies `. + + +.. _install_from_source: + +Installing from source +====================== + +If you are interested in contributing to Matplotlib development, +running the latest source code, or just like to build everything +yourself, it is not difficult to build Matplotlib from source. Grab +the latest *tar.gz* release file from `the PyPI files page +`_, or if you want to +develop Matplotlib or just need the latest bugfixed version, grab the +latest git version :ref:`install-from-git`. + +The standard environment variables `CC`, `CXX`, `PKG_CONFIG` are respected. +This means you can set them if your toolchain is prefixed. This may be used for +cross compiling. +:: + + export CC=x86_64-pc-linux-gnu-gcc + export CXX=x86_64-pc-linux-gnu-g++ + export PKG_CONFIG=x86_64-pc-linux-gnu-pkg-config + +Once you have satisfied the requirements detailed below (mainly +Python, NumPy, libpng and FreeType), you can build Matplotlib. +:: + + cd matplotlib + python setup.py build + python setup.py install + +We provide a `setup.cfg +`_ +file that goes with :file:`setup.py` which you can use to customize +the build process. For example, which default backend to use, whether +some of the optional libraries that Matplotlib ships with are +installed, and so on. This file will be particularly useful to those +packaging Matplotlib. + +If you have installed prerequisites to nonstandard places and need to +inform Matplotlib where they are, edit ``setupext.py`` and add the base +dirs to the ``basedir`` dictionary entry for your ``sys.platform``; +e.g., if the header of some required library is in +``/some/path/include/someheader.h``, put ``/some/path`` in the +``basedir`` list for your platform. + +.. _install_requirements: + +Dependencies +------------ + +Matplotlib requires a large number of dependencies: + + * `Python `_ (>= 2.7 or >= 3.4) + * `NumPy `_ (>= |minimum_numpy_version|) + * `setuptools `__ + * dateutil (>= 1.1) + * `pyparsing `__ + * `libpng `__ (>= 1.2) + * `pytz `__ + * FreeType (>= 2.3) + * `cycler `__ (>= 0.10.0) + * `six `_ + * `backports.functools_lru_cache `_ + (for Python 2.7 only) + * `subprocess32 `_ (for Python + 2.7 only, on Linux and macOS only) + +Optionally, you can also install a number of packages to enable better user +interface toolkits. See :ref:`what-is-a-backend` for more details on the +optional Matplotlib backends and the capabilities they provide. + + * :term:`tk` (>= 8.3, != 8.6.0 or 8.6.1): for the TkAgg backend; + * `PyQt4 `_ (>= 4.4) or + `PySide `_: for the Qt4Agg backend; + * `PyQt5 `_: for the Qt5Agg backend; + * :term:`pygtk` (>= 2.4): for the GTK and the GTKAgg backend; + * :term:`wxpython` (>= 2.8 or later): for the WX or WXAgg backend; + * `pycairo `_: for GTK3Cairo; + * `Tornado `_: for the WebAgg backend. + +For better support of animation output format and image file formats, LaTeX, +etc., you can install the following: + + * `ffmpeg `__/`avconv + `__ or `mencoder + `__ (for saving movies); + * `ImageMagick `__ (for saving + animated gifs); + * `Pillow `__ (for a larger selection of image + file formats: JPEG, BMP, and TIFF image files); + * `LaTeX `_ and `GhostScript `_ + (for rendering text with LaTeX); + +.. 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. + +.. note:: + + The following libraries are shipped with Matplotlib: + + - `Agg`: the Anti-Grain Geometry C++ rendering engine; + - `qhull`: to compute Delaunay triangulation; + - `ttconv`: a true type font utility. + +.. _build_linux: + +Building on Linux +----------------- + +It is easiest to use your system package manager to install the dependencies. + +If you are on Debian/Ubuntu, you can get all the dependencies +required to build Matplotlib with:: + + sudo apt-get build-dep python-matplotlib + +If you are on Fedora, you can get all the dependencies required to build +Matplotlib with:: + + sudo dnf builddep python-matplotlib + +If you are on RedHat, you can get all the dependencies required to build +Matplotlib by first installing ``yum-builddep`` and then running:: + + su -c "yum-builddep python-matplotlib" + +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 +----------------- + +The build situation on macOS is complicated by the various places one +can get the libpng and FreeType requirements (MacPorts, Fink, +/usr/X11R6), the different architectures (e.g., x86, ppc, universal), and +the different macOS versions (e.g., 10.4 and 10.5). We recommend that you build +the way we do for the macOS release: get the source from the tarball or the +git repository and install the required dependencies through a third-party +package manager. Two widely used package managers are Homebrew, and MacPorts. +The following example illustrates how to install libpng and FreeType using +``brew``:: + + brew install libpng freetype pkg-config + +If you are using MacPorts, execute the following instead:: + + port install libpng freetype pkgconfig + +After installing the above requirements, install Matplotlib from source by +executing:: + + python setup.py install + +Note that your environment is somewhat important. Some conda users have +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. + +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 `_ +* Wheels by using conda packages +* Conda packages + +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. + +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 + 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...) + conda install pyqt + # this package is only available in the conda-forge channel + conda install -c conda-forge msinttypes + # for Python 2.7 + conda install -c conda-forge backports.functools_lru_cache + + # copy the libs which have "wrong" names + set LIBRARY_LIB=%CONDA_DEFAULT_ENV%\Library\lib + mkdir lib || cmd /c "exit /b 0" + copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib + copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib + + # Make the header files and the rest of the static libs available during the build + # CONDA_DEFAULT_ENV is a env variable which is set to the currently active environment path + set MPLBASEDIRLIST=%CONDA_DEFAULT_ENV%\Library\;. + + # build the wheel + python setup.py bdist_wheel + +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 diff --git a/README.osx b/README.osx deleted file mode 100644 index 0b30c3d98101..000000000000 --- a/README.osx +++ /dev/null @@ -1,31 +0,0 @@ -Building mpl on OSX is sometimes a nightmare because of all the -different types of zlib, png and freetype that may be on your system. - -For developers who want to build matplotlib from source, the recommended and -supported way to build is to use a third-party package manager to install the -required dependencies, and then install matplotlib from source using the -setup.py script. Two widely used package managers are homebrew, and -MacPorts. The following example illustrates how to install libpng and freetype -using brew: - -Example usage:: - - brew install libpng freetype pkg-config - -If you are using MacPorts, execute the following instead: - -Example usage:: - - port install libpng freetype pkgconfig - -To install matplotlib from source, execute: - -Example usage:: - - python setup.py install - - -Note that your environment is somewhat important. Some conda users have -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. diff --git a/README.rst b/README.rst index f60c4cca7b0e..553ec7ec279e 100644 --- a/README.rst +++ b/README.rst @@ -20,21 +20,25 @@ .. _Depsy: http://depsy.org/package/python/matplotlib ########## -matplotlib +Matplotlib ########## -matplotlib is a Python 2D plotting library which produces publication-quality -figures in a variety of hardcopy formats and interactive -environments across platforms. matplotlib can be used in Python -scripts, the Python and IPython shell (ala MATLAB or Mathematica), web -application servers, and various graphical user interface toolkits. +Matplotlib is a Python 2D plotting library which produces publication-quality +figures in a variety of hardcopy formats and interactive environments across +platforms. Matplotlib can be used in Python scripts, the Python and IPython +shell (à la MATLAB or Mathematica), web application servers, and various +graphical user interface toolkits. `Home page `_ Installation -============= +============ -For installation instructions and requirements, see the INSTALL file or the `install `_ documentation. If you think you may want to contribute to matplotlib, check out the `guide to working with the source code `_. +For installation instructions and requirements, see the INSTALL.rst file or the +`install `_ documentation. If you +think you may want to contribute to matplotlib, check out the `guide to +working with the source code +`_. Testing ======= diff --git a/README.win.md b/README.win.md deleted file mode 100644 index b6d481ed38e3..000000000000 --- a/README.win.md +++ /dev/null @@ -1,67 +0,0 @@ -# Building on Windows - -There are a few possibilities to build matplotlib on Windows: - -* Wheels via [matplotlib-winbuild](https://github.com/jbmohler/matplotlib-winbuild) -* Wheels by using conda packages -* Conda packages - -## 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. - -The commands below assume that you can compile a native python lib for the python version of your -choice. See [this howto](http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/) -how to install and setup such environments. If in doubt: use python 3.5 as it mostly works -without fiddling with environment variables. - -``` sh -# 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 -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...) -conda install pyqt -# this package is only available in the conda-forge channel -conda install -c conda-forge msinttypes -# for python 2.7 -conda install -c conda-forge backports.functools_lru_cache - -# copy the libs which have "wrong" names -set LIBRARY_LIB=%CONDA_DEFAULT_ENV%\Library\lib -mkdir lib || cmd /c "exit /b 0" -copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib -copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib - -# Make the header files and the rest of the static libs available during the build -# CONDA_DEFAULT_ENV is a env variable which is set to the currently active environment path -set MPLBASEDIRLIST=%CONDA_DEFAULT_ENV%\Library\;. - -# build the wheel -python setup.py bdist_wheel -``` - -The `build_alllocal.cmd` script automates these steps if you already created and activated the conda environment. - - -## Conda packages - -This needs a [working installed C compiler](http://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. - -```sh -# 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 -``` diff --git a/doc/make.py b/doc/make.py index 86aae03e8ba6..fe07c40c2b86 100755 --- a/doc/make.py +++ b/doc/make.py @@ -224,7 +224,7 @@ def build_all(): # Change directory to the one containing this file current_dir = os.getcwd() os.chdir(os.path.dirname(os.path.join(current_dir, __file__))) -copy_if_out_of_date('../INSTALL', 'users/installing.rst') +copy_if_out_of_date('../INSTALL.rst', 'users/installing.rst') # Create the examples symlink, if it doesn't exist