In article <E1FCyK8-0006g5-Mw@...>,
fuzzyman@... wrote:
> {emo;contour} I've managed to get `matplotlib
> <http://matplotlib.sourceforge.net/>`_ working for `Movable Python
> <http://www.voidspace.org.uk/python/movpy>`_.
>
> .. note::
>
> This means that it must be possible to get **matplotlib** working with
> `py2exe <http://www.py2exe.org>`_.
>
> There is a download linked to at the bottom of this post which contains
> the files to use matplotlib with Python 2.4.2. They should work with
> **Movable Python** *or* a normal Python installation.
>
> This means that `numarray
> <http://www.stsci.edu/resources/software_hardware/numarray>`_ also works.
>
> Unfortunately it looks like I'm going to have to do a bit of work (although
> probably not much) to get `IPython <http://ipython.scipy.org/>`_ working in
> `pylab mode
> <http://ipython.scipy.org/doc/manual/node15.html#sec:matplotlib-support>`_.
> It should currently be possible to follow the `matplotlib interactive
> <http://matplotlib.sourceforge.net/interactive.html>`_ instructions and use
> it from a PyCrust shell.
>
> The **matplotlib** folks didn't make my life easy when it came to getting
> this working. I was installing it for Python 2.4 on Windows. The
> `installation instructions
> <http://matplotlib.sourceforge.net/installing.html>`_ say :
>
> *For standard python installations, you will also need to install either
> Numeric or numarray in addition to the matplotlib installer. matplotlib
> provides installers for Numeric and numarray users. It is important that
> you pick the matplotlib installer that corresponds to your array package.
> Ie, if you mostly work with numarray arrays, use the matplotlib numarray
> installer. matplotlib has a numerix setting in the matplotlib rc file
> (which by default resides in*
> ``c:\python23\share\matplotlitb\matplotlibrc)`` *and you should make sure
> this setting corresponds to your preferred array package.*
>
> So I have to choose numeric or numarray and pick the right installer for
> matplotlib ? Sounds easy enough. {sm;:wink:}
>
> So you go to `download matplotlib
> <http://sourceforge.net/project/showfiles.php?group_id=80706>`_, and discover
> that only one installer is available for Windows. It doesn't mention numeric
> or numarray at all. Oh well, my user has specified numarray, so I `fetch
> that
> <http://sourceforge.net/project/showfiles.php?group_id=1369&release_id=223264>
> `_ as well and install.
Numeric, numarray and numpy are three different packages that all do
pretty much the same thing. Numeric came first (and, to make things
really confusing, it was also called numpy, but the current numpy is
different).
numarray was written to replace Numeric, and for awhile that looked like
it might happen. But then somehow it didn't. Numeric got a few updates
and then some of the same folks decided to create a new package called
numpy that apparently combines the best of both.
There's some hope that numpy will become the standard (and even be
included with python), but we'll see. numpy is still in prerelease and
in flux, so I'd suggest installing Numeric and/or numarray for now. I
think the windows matplotlib was built with support for all at least
Numeric and numarray.
> I run one of the example programs and it complains that it can't find numeric
> ! Maybe the only version they offer now is for numeric, so I look for numeric
> and discover that it's now called `numpy <http://numeric.scipy.org/>`_ and
> that installing that results in the same error. {sm;:???:}
?
> Anyway - to cut a sadly longer story short, I eventually work out that the
> windows installer for **matplotlib** *hasn't* created a ``matplotlibrc``
> file. I copy the one from `here
> <http://matplotlib.sourceforge.net/matplotlibrc>`_ to ``C:\Documents and
> Settings\$USERNAME$\.maplotlib``. Some progress - now it's complaining about
> an ``ImportError`` when looking for a module called ``gobject``, which is
> part of GTK the default backend for matplotlib.
The windows matplotlib installer puts a matplotlibrc here, along with
other important data files:
>>> matplotlib.get_data_path()
'\Program Files\\Python24\\lib\\site-packages\\matplotlib\\mpl-data'
Note that this does not match where the py2exe example programs say to
look. I think the directory moved in some recent release of matplotlib.
My own setup.py (which is NOT fully working yet, but does correctly copy
the matplotlib data files) actually gets the dir from
matplotlib.get_data_path() rather than hard-coding it. I'm not positive
that works if the user has set up a private matplotlibrc.
-- Russell
|