@@ -181,21 +181,37 @@ OS-X Notes
181181Which python for OS X?
182182----------------------
183183
184- Apple ships with its own python, and many users have had trouble
185- with it. There are several alternative versions of python that
186- can be used. If it is feasible, we recommend that you use
187- `Enthought Canopy <https://www.enthought.com/products/canopy/ >`_
188- for OS X (which comes with matplotlib and much more). Also available is
189- `MacPython <http://wiki.python.org/moin/MacPython/Leopard >`_ or the
190- official OS X version from `python.org <http://www.python.org/download/ >`_.
184+ Apple ships OS X with its own python, but it is generally recommended
185+ that users install an independent python system and use that
186+ as the basis for installing libraries such as numpy and
187+ matplotlib. By far the easiest method is to use one
188+ of the excellent python software collections that are now
189+ available:
190+
191+ - Anaconda _ from `Continuum Analytics `_
192+ - Canopy _ from Enthought _
193+
194+ .. _Canopy : https://enthought.com/products/canopy/
195+ .. _Anaconda : https://store.continuum.io/cshop/anaconda/
196+ .. _Enthought : http://enthought.com
197+ .. _Continuum Analytics : http://continuum.io
198+
199+ These collections include python itself and a wide range of
200+ libraries; if you need a library that is not available from
201+ the collection, you can install it yourself using standard
202+ methods such as *pip *.
203+
204+ If you choose not to use a collection, then you may use an
205+ installer from `python.org
206+ <https://www.python.org/downloads/mac-osx/> `_, or use a
207+ general package management system such as `homebrew
208+ <http://brew.sh> `_ or `macports <http://www.macports.org >`_.
209+ Whatever you choose, choose one and stick with it--don't try
210+ to mix homebrew and macports, for example. You may,
211+ however, use homebrew or macports for all your non-python
212+ software, and still use Anaconda _ or Canopy _ for your python
213+ system.
191214
192- .. note ::
193- Before installing any of the binary packages, be sure that all of the
194- packages were compiled for the same version of python.
195- Often, the download site for NumPy and matplotlib will display a
196- supposed 'current' version of the package, but you may need to choose
197- a different package from the full list that was built for your
198- combination of python and OSX.
199215
200216
201217.. _install_osx_binaries :
@@ -208,6 +224,14 @@ build, you have two choices: a mpkg installer, which is a typical
208224Installer.app, or a binary OSX egg, which you can install via
209225setuptools' easy_install.
210226
227+ .. note ::
228+ Before installing any of the binary packages, be sure that all of the
229+ packages were compiled for the same version of python.
230+ Often, the download site for NumPy and matplotlib will display a
231+ supposed 'current' version of the package, but you may need to choose
232+ a different package from the full list that was built for your
233+ combination of python and OSX.
234+
211235The mkpg installer will have a "zip" extension, and will have a name
212236like :file: `matplotlib-1.2.0-py2.7-macosx10.5_mpkg.zip `.
213237The name of the installer depends on which versions of python, matplotlib,
@@ -235,64 +259,20 @@ then you will need to set your PYTHONPATH, eg::
235259
236260See also ref:`environment-variables `.
237261
238- .. _install_from_source_on_osx_epd :
239-
240- Building and installing from source on OSX with EPD
241- ---------------------------------------------------
242-
243- If you have the EPD installed (:ref: `which-python-for-osx `), it might turn out
244- to be rather tricky to install a new version of matplotlib from source on the
245- Mac OS 10.5 . Here's a procedure that seems to work, at least sometimes:
246262
247- 0. Remove the ~/.matplotlib folder ("rm -rf ~/.matplotlib").
248-
249- 1. Edit the file (make a backup before you start, just in case):
250- ``/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile ``,
251- removing all occurrences of the string ``-arch ppc ``, changing the line
252- ``MACOSX_DEPLOYMENT_TARGET=10.3 `` to ``MACOSX_DEPLOYMENT_TARGET=10.5 `` and
253- changing the occurrences of ``MacOSX10.4u.sdk `` into ``MacOSX10.5.sdk ``
254-
255- 2. In
256- ``/Library/Frameworks/Python.framework/Versions/Current/lib/pythonX.Y/site-packages/easy-install.pth ``,
257- (where X.Y is the version of Python you are building against)
258- Comment out the line containing the name of the directory in which the
259- previous version of MPL was installed (Looks something like
260- ``./matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg ``).
263+ Windows Notes
264+ =============
261265
262- 3. Save the following as a shell script, for example
263- ``./install-matplotlib-epd-osx.sh ``::
266+ Recommendation: use one of the excellent multi-platform
267+ python collections which include python itself and a wide
268+ range of libraries including matplotlib:
264269
265- NAME=matplotlib
266- VERSION=v1.1.x
267- PREFIX=$HOME
268- #branch="release"
269- branch="master"
270- git clone git://github.com/matplotlib/matplotlib.git
271- cd matplotlib
272- if [ $branch = "release" ]
273- then
274- echo getting the maintenance branch
275- git checkout -b $VERSION origin/$VERSION
276- fi
277- export CFLAGS="-Os -arch i386"
278- export LDFLAGS="-Os -arch i386"
279- export PKG_CONFIG_PATH="/usr/x11/lib/pkgconfig"
280- export ARCHFLAGS="-arch i386"
281- python setup.py build
282- # use --prefix if you don't want it installed in the default location:
283- python setup.py install #--prefix=$PREFIX
284- cd ..
285-
286- Run this script (for example ``sh ./install-matplotlib-epd-osx.sh ``) in the
287- directory in which you want the source code to be placed, or simply type the
288- commands in the terminal command line. This script sets some local variable
289- (CFLAGS, LDFLAGS, PKG_CONFIG_PATH, ARCHFLAGS), removes previous installations,
290- checks out the source from github, builds and installs it. The backend should
291- to be set to MacOSX.
270+ - Anaconda _ from `Continuum Analytics `_
271+ - Canopy _ from Enthought _
292272
273+ A Windows-only alternative is:
293274
294- Windows Notes
295- =============
275+ - `python (x, y) <http://www.pythonxy.com >`_
296276
297277.. _windows-installers :
298278
@@ -307,12 +287,3 @@ you installed Python 2.7) which have the ``exe`` extension. If you
307287haven't already installed python, you can get the official version
308288from the `python web site <http://python.org/download/ >`_.
309289
310- There are also two packaged distributions of python that come
311- preloaded with matplotlib and many other tools like ipython, numpy,
312- scipy, vtk and user interface toolkits. These packages are quite
313- large because they come with so much, but you get everything with
314- a single click installer.
315-
316- * `Enthought Canopy <https://www.enthought.com/products/canopy/ >`_
317-
318- * `python (x, y) <http://www.pythonxy.com >`_
0 commit comments