On Wed, Nov 17, 2010 at 1:54 PM, Eric Emsellem <eemselle@...> wrote:
> Dear Ben
> thanks a lot for this thoughful answer.
> When I use only "ipython" and not "ipython -pylab" IT WORKS!!!
> So this is a problem with "ipython -pylab" call...
> Any thought of why this is?
Possibly ipython is somehow configured to pull pylab from a different
location, thereby loading a different matplotlib (and under a different
name) from what mplot3d loads. Remember, python loads modules only once
during an execution, regardless of the number of times an import statement
appears. With ipython -pylab, it implicitly does these loads for you
(except for mplot3d because it is a separate toolkit). If ipython was
explicitly configured to look elsewhere for pylab, and then you come along
and tell it to import mplot3d using the normal python search path, it
*might* be possible that different matplotlibs got loaded. Again, though,
this is complete and utter speculation, and has little basis in fact nor
> I provide more info below
> thanks for any help there.
> P.S.: Here is the output of my setup:
> In : matplotlib.__file__
> Out: '/usr/lib64/python2.6/site-packages/matplotlib/__init__.pyc'
> In : mpl_toolkits.mplot3d.__file__
Clarity is important here. Was this the same regardless of using '-pylab'?
Also, if you run "ipython -pylab", what is the value of pylab.__file__ and
how does it compare to matplotlib.__file__ and
> A funny one is that I have to import mpl_toolkits first and then mplot3d,
> when I do this I get:
> In : from mpl_toolkits import mplot3d
> try this
> I am not sure the "try this" is meant to be there....
It isn't, but I can not find it anywhere in the source files. I have
checked the source code for matplotlib from the OpenSUSE repos and from our
svn repos. It does not exist. That line must be coming from another
package or you may have forgotten you added it (this has happened to me
> Here is my detailed setup when I do ipython -pylab
> matplotlib data path /usr/lib64/python2.6/site-packages/matplotlib/mpl-data
> matplotlib version 1.0.0
> verbose.level helpful
> interactive is False
> units is False
> platform is linux2
> Your PyGtk has set_interactive(), so you can use the
> more stable single-threaded Gtk mode.
> See https://bugs.launchpad.net/ipython/+bug/270856
> backend GTKAgg version 2.17.0
> Python 2.6.5 (r265:79063, Jul 5 2010, 11:46:13)
> IPython 0.10 -- An enhanced Interactive Python.