[IPython-user] Getting require('matplotlib') and -pylab to play together

Ville M. Vainio vivainio@gmail....
Tue Aug 14 02:25:29 CDT 2007

On 8/14/07, Ludwig Schwardt <ludwig.schwardt@gmail.com> wrote:

> We are compiling and installing numpy, scipy and matplotlib using Easy
> Install in "multi-version" mode. This requires the following lines
> before these packages can be imported:
> from pkg_resources import require
> require(['numpy','scipy','matplotlib'])
> I added these lines to my ipythonrc, which works fine. Problems start

Please use ipy_user_conf.py instead of the deprecated ipythonrc.

> when I start ipython with the -pylab flag, however, as this tries to
> import matplotlib before reading the config file.

Yeah, pylab features are set up earlier than the config parsin,
because config files generally assume most of the stuff in ipython to
be in place.

I was wondering - perhaps we could try to do this "require" IFF
setuptools is installed, and matplotlib import fails. Then we could a
more complete "out of the box" experience... and for numpy and scipy
as well.

OTOH, we would probably require the user to accept a confirmation
prompt before downloading anything.

In the meantime, having your own version of startup script, which is
trivial on purpose, is a completely valid solution

Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'

More information about the IPython-user mailing list