|
From: Steve S. <el...@gm...> - 2005-08-09 18:46:56
|
John Hunter wrote: >>>>>>"Steve" == Steve Schmerler <el...@gm...> writes: > > > Steve> Hi I recently posted something about segfaults I get when > Steve> plotting. Now here is a little update and I really hope > Steve> someone has an idea how I can solve this problem. > > Steve> I'm running IPython 0.6.13 on a Debian box, installed the > Steve> recent mpl 0.83.2 from source, GTKAgg backend. > > Steve> 1) > > Steve> When I start ipython (as normal user) with the -pylab > Steve> option and then say > > Steve> plot([1,2,3]) > > Steve> I get > > Steve> In [1]: plot([1,2,3]) > Steve> --------------------------------------------------------------------------- > Steve> exceptions.SystemError Traceback (most recent call last) > > > Steve> SystemError: ../Objects/moduleobject.c:48: bad argument to > Steve> internal function > > You say this is a segfault, but it looks like an exception. Does this > actually kill the ipython shell? Is this a full posting of the > traceback? I upgraded to IPython 0.6.15 (installed from source), the former 0.6.13 was apt-get installed on Debian (sarge, stable). Actually, it is a segfault, and it kills the IPython shell. ############################################################################### elcorto@bach:~/Install/IPython$ ipython -pylab /usr/lib/python2.3/site-packages/IPython/Shell.py:627: GtkDeprecationWarning: gtk.timeout_add is deprecated, use gobject.timeout_add instead self.gtk.timeout_add(self.TIMEOUT, self.on_timer) Python 2.3.5 (#2, May 4 2005, 08:51:39) Type "copyright", "credits" or "license" for more information. IPython 0.6.15 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. Welcome to pylab, a matplotlib-based Python environment. For more information, type 'help(pylab)'. In [1]: plot([1,2,3]) --------------------------------------------------------------------------- exceptions.SystemError Traceback (most recent call last) SystemError: ../Objects/moduleobject.c:48: bad argument to internal function Speicherzugriffsfehler elcorto@bach:~/Install/IPython$ ################################################################################# At least "Speicherzugriffsfehler" is german for segfault :) I still can plot as root, but not as user!? If it's some kind of permission problem it would be good to know something about "../Objects/moduleobject.c". I there a way to get IPython to print the full path? BTW, Fernando mentioned earlier that this GtkDeprecationWarning would go away if I upgrade to IPython 0.6.15 but unfortunately it's still there. > > What happens if you run the following script outside of ipython > > from pylab import plot, show > plot([1,2,3]) > show() > > with > > > python test.py --verbose-helpful > > Does this create a proper figure window -- please post all output from > the script. > This works, a window shows up. ################################################################################# elcorto@bach:~/Install/IPython$ python test.py --verbose-helpful matplotlib data path /usr/share/matplotlib $HOME=/home/elcorto CONFIGDIR=/home/elcorto/.matplotlib loaded rc file /usr/share/matplotlib/matplotlibrc matplotlib version 0.83.2 verbose.level helpful interactive is False platform is linux2 numerix Numeric 23.8 font search path ['/usr/share/matplotlib'] loaded ttfcache file /home/elcorto/.matplotlib/ttffont.cache backend GTKAgg version 2.6.1 ################################################################################# > > Steve> 2) > > Steve> However when I change to root > > Steve> su <pwd> > > Steve> ipython -pylab > > Steve> then plotting works fine!? > > Perhaps this has something to do with having permission to connect to > the X11 server? As a normal user, can you launch graphical apps from > the shell, eg > > > gedit& > I can do that. > > Have you done anything unusual with your system, changed the default > permission bits, done a chroot, etc? What linux distro are you > running? > > > Steve> I have no idea where this moduleobject.c lives or to which > Steve> application it belongs. > > Steve> 2) > > Steve> If I try the same with the normal python interpreter > > Steve> python > > Steve> from pylab import *; ion() plot([1,2,3]) > > Steve> a plot window pops up but shows no picture (no matter if > Steve> I'm root or not). > > Debian sarge, stable. I'm not a Linux expert but it's a pretty fresh installation (on my computer at work) and I can't see what I should have done wrong. In fact I installed mpl on my (the same) Debian at home and it works fine there (OK it's mpl 0.81 and IPython 0.6.13). > GTKAgg is not expected to work unless you are in a special threaded > environment like ipython with -gthread or -pylab. Try the same with > the TkAgg backend (edit your rc file) and let me know what happens. > Uh, I didn't build TkAgg, So I set BUILD_TKAGG = 'auto', but python setup.py build fails: [...] src/_tkagg.cpp:26:19: tk.h: Datei oder Verzeichnis nicht gefunden (file not found) [...] error: command 'gcc' failed with exit status 1 Do I have to install something besides python-tk? > The last thing I'd advise is upgrading your ipython to the latest. > > I've never seen this one before so I'm flying by the seat of my pants. > > I hope we can sort this out. cheers, steve |