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

DOC refactored installation instruction #8240

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 13 commits into from
Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
DOC refactored installation instruction
  • Loading branch information
NelleV committed Mar 20, 2017
commit 0acf41e3c56445b9cd75bb0a53866f31f4435e28
99 changes: 96 additions & 3 deletions 99 INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
.. 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
Expand Down Expand Up @@ -325,7 +325,32 @@ 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`.
git repository and install the required dependencies through a third-party
package manager: two widely used package managers are homebrew, and MacPorts.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest the was clarify that this whole section is for is when you're not using conda

Also suggest:
"through a third-party package manager such as homebrew <https://brew.sh/>_ or MacPorts <https://www.macports.org/>_"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this whole document needs to be consolidated.

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.


.. _build_windows:
Expand All @@ -341,3 +366,71 @@ 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 <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>`_
* 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::

# 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python=3.5 per the previous sentence?

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 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::

# 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
31 changes: 0 additions & 31 deletions 31 README.osx

This file was deleted.

18 changes: 11 additions & 7 deletions 18 README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 (ala MATLAB or Mathematica), web application servers, and various
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you know how to spell "à la" (it's correct even in English, see https://en.wiktionary.org/wiki/%C3%A0_la)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QuLogic is going to do a pass over it, but it might be easier for me to fix this one considering my awesome french keyboard (Yéǎh¡!).
I'll do another pass tonight to check for this particular point )

graphical user interface toolkits.

`Home page <http://matplotlib.org/>`_

Installation
=============

For installation instructions and requirements, see the INSTALL file or the `install <http://matplotlib.org/users/installing.html>`_ documentation. If you think you may want to contribute to matplotlib, check out the `guide to working with the source code <http://matplotlib.org/devel/gitwash/index.html>`_.
For installation instructions and requirements, see the INSTALL file or the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it called INSTALL.rst in this PR now?

`install <http://matplotlib.org/users/installing.html>`_ documentation. If you
think you may want to contribute to matplotlib, check out the `guide to
working with the source code
<http://matplotlib.org/devel/gitwash/index.html>`_.

Testing
=======
Expand Down
67 changes: 0 additions & 67 deletions 67 README.win.md

This file was deleted.

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