-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Changes from 1 commit
0acf41e
b55412e
3044d12
60a1b64
36a917c
f55ed17
37af9a6
8ee8a93
1159085
86be684
9265b4a
bafe158
dd08c3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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. | ||
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: | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) There was a problem hiding this comment. Choose a reason for hiding this commentThe 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¡!). |
||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
======= | ||
|
This file was deleted.
There was a problem hiding this comment.
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/>
_ orMacPorts <https://www.macports.org/>
_"There was a problem hiding this comment.
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.