-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
DOC refactored installation instruction #8240
Conversation
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 a good change. It'll be nice to have this all in one spot.
INSTALL
Outdated
@@ -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. |
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/>
_ or MacPorts <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.
INSTALL
Outdated
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 comment
The reason will be displayed to describe this comment to others. Learn more.
python=3.5 per the previous sentence?
INSTALL
Outdated
Matplotlib and most of its dependencies all available as wheel packages for | ||
OSX, windows and many linux distributions:: | ||
|
||
pip install -U numpy scipy scikit-learn |
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.
should this just be pip install -U matplotlib
?
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.
Yep it should… copy paste gone wrong.
INSTALL
Outdated
optional Matplotlib backends and the capabilities they provide. | ||
|
||
* :term:`tk` (>= 8.3, != 8.6.0 or 8.6.1): for the TkAgg backend; | ||
* :term:`pyqt` (>= 4.4): for the Qt4Agg backend; |
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.
should mention qt5 as well. I could have sworn that this already said both...
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.
well… we have another section where we list dependencies: it is mentioned there.
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.
Actually, there are many optional dependencies missing from this list. Aren't pycairo and pyside also optional dependencies?
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.
Yes
INSTALL
Outdated
* `six <https://pypi.python.org/pypi/six>`_ | ||
* `backports.functools_lru_cache <https://pypi.python.org/pypi/backports.functools_lru_cache>`_ | ||
(for Python 2.7 only) | ||
* `subprocess32 <https://pypi.python.org/pypi/subprocess32/>`_ (for Python |
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.
the '*nix' got dropped here.
So @tacaswell 's review underlined that we list dependencies twice: once for everything, and another time for windows. I'll try to consolidate this. |
INSTALL
Outdated
|
||
* :term:`tk` (>= 8.3, != 8.6.0 or 8.6.1): for the TkAgg backend; | ||
* :term:`pyqt` (>= 4.4): for the Qt4Agg backend; | ||
* :term:`pygtk` (>= 2.4): for the GTK and the GTKAgg backend; |
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.
did we lose pygtk3
at somepoint? I have lost track of exactly how that is packaged at this point...
|
||
|
||
Required libraries that ship with matplotlib | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
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.
Probably should keep this section someplace.
Minor suggestion: can you rename INSTALL to INSTALL.rst? This will render it properly on github and syntax-highlight it correctly on editors that can. This is also consistent with having README.rst. |
I am wondering what people think of moving this file down to the documentation folder. It's barely readable as a text file as it has a lot of sphinx-specific syntax. We could then refer to it in the README.rst. |
There is a pretty strong tradition of having a top-level INSTALL file. Adding the rst extenstion is reasonable |
OK, so I renamed it to INSTALL.rst. I think this PR is good to go for a review. Our installation instructions do need a lot of love, and I think this is just a first pass on it. |
INSTALL.rst
Outdated
Matplotlib and most of its dependencies all available as wheel packages for | ||
OSX, windows and many linux distributions:: | ||
|
||
pip install -U matplotlib |
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.
This is true for linux and osx, but it'd be nice to check for windows!
INSTALL.rst
Outdated
@@ -0,0 +1,363 @@ | |||
.. The source of this document is INSTALL. During the doc build process, |
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.
This needs to be updated.
@anntzer the command pip install matplotlib does work out of the box on windows. So I think everything is correct in this PR. |
INSTALL.rst
Outdated
Installing an official release | ||
============================== | ||
|
||
Matplotlib and most of its dependencies all available as wheel packages for |
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.
"are all"
INSTALL.rst
Outdated
============================== | ||
|
||
Matplotlib and most of its dependencies all available as wheel packages for | ||
OSX, windows and many linux distributions:: |
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.
"and Linux distributions" (sure manylinux technically doesn't cover very old distros but I guess very old macos are likewise not supported too...)
(capitalize Linux for consistency with below)
INSTALL.rst
Outdated
======================================= | ||
|
||
Scientific Python distributions: Conda, Canopy... | ||
-------------------------------------------------- |
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.
one too many "-"
INSTALL.rst
Outdated
is packaged for almost every major Linux distribution. | ||
|
||
* Debian / Ubuntu : ``sudo apt-get install python-matplotlib`` | ||
* Fedora / Redhat : ``sudo yum install python-matplotlib`` |
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.
Red Hat.
on Arch, sudo pacman -S python-matplotlib
(if you care to add it)
Depending on the distro it may be either python-matplotlib/python2-matplotlib (e.g. Fedora, Arch) or python-matplotlib/python3-matplotlib. Check at https://pkgs.org/download/matplotlib.
INSTALL.rst
Outdated
|
||
We strongly recommend using `scipy-stack compatible Python distributions | ||
<http://www.scipy.org/install.html>`_ such as WinPython, Python(x,y), | ||
Enthought Canopy, or Continuum Anaconda, which have Matplotlib and many of its |
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.
... and its dependencies ("many" implies some are missing?)
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 am fine changing this (this was not written by me), though I have no clue whether all of these include all dependencies.
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 we shouldn't recommend Python(x,y) any more - it is only Python 2.7.
INSTALL.rst
Outdated
* `ImageMagick <http://www.imagemagick.org/script/index.php>`__ (for saving | ||
animated gifs); | ||
* `Pillow <http://python-pillow.org/>`__ (for a larger selection of image | ||
file format: JPEG, BMP, and TIFF image files); |
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.
"formats". Also only needed for reading, IIRC?
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.
That would be surprising. I think it is for IO, but both reading and writing though I have no clue on that one.
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.
eh "I think it is for all IO, so both reading and writing"…
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 don't think we can write to all these image formats, can we?
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.
Indeed we can't:
In [1]: fig, ax = plt.subplots()
a
In [2]: ax.plot(np.arange(100))
Out[2]: [<matplotlib.lines.Line2D at 0x7fe9a1b02048>]
In [3]: fig.savefig("test.jpeg")
In [4]: fig.savefig("test.bmp")
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-4-25b9508e5148> in <module>()
----> 1 fig.savefig("test.bmp")
/home/nelle/Projects/matplotlib/lib/matplotlib/figure.py in savefig(self, *args, **kwargs)
1761 self.set_frameon(frameon)
1762
-> 1763 self.canvas.print_figure(*args, **kwargs)
1764
1765 if frameon:
/home/nelle/Projects/matplotlib/lib/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)
2132
2133 # get canvas object and print method for format
-> 2134 canvas = self._get_output_canvas(format)
2135 print_method = getattr(canvas, 'print_%s' % format)
2136
/home/nelle/Projects/matplotlib/lib/matplotlib/backend_bases.py in _get_output_canvas(self, format)
2075 raise ValueError('Format "%s" is not supported.\n'
2076 'Supported formats: '
-> 2077 '%s.' % (format, ', '.join(formats)))
2078
2079 def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,
ValueError: Format "bmp" is not supported.
Supported formats: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff.
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.
Well, more specifically, we can't write to BMP, but the rest is apparently fine (I do have pillow installed).
INSTALL.rst
Outdated
|
||
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 |
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.
"and" -> ","
plus a second comma before the last "and" if you like oxford commas.
INSTALL.rst
Outdated
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 install the required dependencies through a third-party | ||
package manager: two widely used package managers are homebrew, and MacPorts. |
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.
Two colons in this sentence.
INSTALL.rst
Outdated
The following example illustrates how to install libpng and freetype using | ||
brew: | ||
|
||
Example usage:: |
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.
Remove "example usage" here and below, tuck the ::
to the previous paragraph.
INSTALL.rst
Outdated
|
||
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 |
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.
Python 3.5+
Thanks for the review @anntzer . I fixed most of the comments. |
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.
just added a few more (tiny) apples
For `standard Python <https://www.python.org/downloads/>`_ installations, | ||
install Matplotlib using pip_:: | ||
|
||
python -m pip install -U pip setuptools |
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.
make this pip install ...
as well for consistency with above then?
README.rst
Outdated
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 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)
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.
@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 )
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 will make the minor modifications directly, but here are some wider reaching comments.
INSTALL.rst
Outdated
============================== | ||
|
||
Matplotlib and most of its dependencies arr all available as wheel packages for | ||
OSX, windows and Linux distributions:: |
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.
Should we change OSX to macOS?
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 so, yes.
INSTALL.rst
Outdated
|
||
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 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.
Should we import this into the Matplotlib organization?
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 am actually slightly worried that this repository is totally out of date. It hasn't bee updated in 2014, so there is maybe a bit of work to be done to have the scripts run.
INSTALL.rst
Outdated
at `matplotlib-winbuild <https://github.com/jbmohler/matplotlib-winbuild>`_. | ||
|
||
|
||
There are a few possibilities to build matplotlib on Windows: |
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.
matplotlib -> Matplotlib
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.
Yep, I've fixed all of these (locally).
INSTALL.rst
Outdated
:ref:`install the latest development version<install_from_source>`. | ||
|
||
|
||
.. contents.. |
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.
should be a colon? http://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html#explicit-links
or just drop this target?
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.
It should. It is really strange that it compiled properly.
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.
It turned into a comment (which explains the colour on GitHub now.)
@anntzer It's fixed. |
README.rst
Outdated
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it called INSTALL.rst in this PR now?
.. contents.. -> .. contents::
This is a small refactoring of the installation instructions. I've mostly merged three files together and did some markup updates.
We now have only on README file, common to the three plateforms. The INSTALL file contains installation instructions for all plateform. It probably needs a bit of love.
Don't hesitate to edit the document directly.