Plotting issue in Karmic

3 views
Skip to first unread message

Rick Brown

unread,
Nov 3, 2009, 2:03:27 PM11/3/09
to spyder
I just installed Spyder in Karmic on a laptop I have. I am having a
weird issue with plotting. It can be reproduced as follows:

Make simple plotting program:

from numpy import *
from matplotlib import *
from pylab import *

x = linspace(0,5,100)
y = sin(x)

plot(x,y)
show()


Run: it makes the plot

close the plot: and try to run it again - gives the folowing error:


Traceback (most recent call last):
File "/home/rick/Temp/untitled0.py", line 9, in <module>
show()
File "/usr/lib/pymodules/python2.6/matplotlib/backends/
backend_qt4.py",
line 63, in show
manager.window.show()
RuntimeError: underlying C/C++ object has been deleted


Has anyone else installed spyder and used it successfully in Ubuntu
Karmic? I should also note that this works fine if I use the external
console rather than the interactive console.

Thanks in advance.

Pierre Raybaut

unread,
Nov 3, 2009, 4:42:04 PM11/3/09
to spyder
Hi,

I've just tested it and you're absolutely right about this issue.
Actually this is not a Spyder's bug but a matplotlib's bug (more
precisely a bug with matplotlib's Qt4 backend which is apparently not
compatible with PyQt4 v4.6, the default PyQt4 version shipped with
Karmic).
Here is how to test it outside Spyder.
If you run an IPython session:
$ ipython --pylab --q4thread
and then enter: "plot([])", then close the figure, and enter again
"plot([])", you'll get the same traceback.

I'll take a look at it as soon as I can: I'm already monkey patching
matplotlib in Spyder to integrate figures, so why not fixing
matplotlib bugs at the same time :)

Thanks for the feedback,
Pierre

Rick Brown

unread,
Nov 3, 2009, 4:45:11 PM11/3/09
to spyder
Thanks for the quick reply. Love the application by the way - has
completely replaced matlab for me.

Would downgrading matplotlib be a temporary fix?

Thanks again!

Pierre Raybaut

unread,
Nov 4, 2009, 1:59:41 AM11/4/09
to spyder
On 3 nov, 22:45, Rick Brown <rjamesbr...@gmail.com> wrote:
> Would downgrading matplotlib be a temporary fix?

I don't think so: on the contrary, downgrading PyQt4 to v4.5.4 would
certainly work.
But let me take a look at it, my first impression is that there should
be an easy fix for matplotlib's Qt4 backend -- I'll try and spend some
time on this before tomorrow.

- Pierre

Rick Brown

unread,
Nov 5, 2009, 4:16:42 PM11/5/09
to spyder
Pierre,

I tried replacing spyder.py and figure.py in /user/local/lib with text
out of the files you posted in the mercurial repository. spyder
started but there were no clickable icons in the toolbars. Am I doing
something wrong? Are there extra characters or something if I just
copy the text out of the files posted? Maybe I should just wait till
the next release of spyder... Thanks for fixing the problem though.

- Rick

Pierre Raybaut

unread,
Nov 6, 2009, 2:04:08 AM11/6/09
to spyder
Rick,

Applying the same changes should work.

But may I suggest to do the following if you want to test the
development version in the best conditions:
$ sudo apt-get install mercurial
$ hg clone https://spyderlib.googlecode.com/hg/ spyder
$ cd spyder
$ sudo python setup.py install

And, in the future, when you want to update to the latest development
snapshot:
(from the 'spyder' directory)
$ hg pull https://spyderlib.googlecode.com/hg/
$ hg up
$ sudo python setup.py install

HTH,
Pierre

Rick Brown

unread,
Nov 8, 2009, 2:24:33 PM11/8/09
to spyder
Pierre,

Just got around to trying this. I uninstalled my previous version of
spyder and did what you outlined above. I still get the exact same
problem I had before - same error. Any advice would be appreciated.

- Rick

On Nov 6, 2:04 am, Pierre Raybaut <pierre.rayb...@gmail.com> wrote:
> Rick,
>
> Applying the same changes should work.
>
> But may I suggest to do the following if you want to test the
> development version in the best conditions:
> $ sudo apt-get install mercurial
> $ hg clonehttps://spyderlib.googlecode.com/hg/spyder
> $ cd spyder
> $ sudo python setup.py install
>
> And, in the future, when you want to update to the latest development
> snapshot:
> (from the 'spyder' directory)
> $ hg pullhttps://spyderlib.googlecode.com/hg/

Pierre Raybaut

unread,
Nov 9, 2009, 1:37:34 AM11/9/09
to spyd...@googlegroups.com
Rick,

What do you mean exactly by "there were no clickable icons in the toolbars"?
Are there any other symptoms?

thx
Pierre

2009/11/8 Rick Brown <rjame...@gmail.com>:

Rick Brown

unread,
Nov 9, 2009, 3:53:51 AM11/9/09
to spyder
I only got the no clickable icons in the toolbars (meaning the
toolbars were empty, but there) when I cut and paste text from the
edited .py files you posted and modified the existing ones in my
spyder installation.

When I tried running the commands you detailed (using mercurial) I get
the same errors I had with the currently release of spyder.

On Nov 9, 1:37 am, Pierre Raybaut <pierre.rayb...@gmail.com> wrote:
> Rick,
>
> What do you mean exactly by "there were no clickable icons in the toolbars"?
> Are there any other symptoms?
>
> thx
> Pierre
>
> 2009/11/8 Rick Brown <rjamesbr...@gmail.com>:

Rick Brown

unread,
Nov 17, 2009, 5:07:58 PM11/17/09
to spyder
Added new issue 121. The version from the mercurial repository does
not seem to work. I get the same exact error.

Tim Michelsen

unread,
Mar 3, 2010, 4:47:05 PM3/3/10
to spyd...@googlegroups.com
Hello!

>> Would downgrading matplotlib be a temporary fix?
>
> I don't think so: on the contrary, downgrading PyQt4 to v4.5.4 would
> certainly work.
> But let me take a look at it, my first impression is that there should
> be an easy fix for matplotlib's Qt4 backend -- I'll try and spend some
> time on this before tomorrow.

I still experience this issue with the latest code from the hg
repository on Ubuntu Karmic.

What do you recommend to get the ploting fixed?

Thanks,
Timmie

Pierre Raybaut

unread,
Mar 6, 2010, 4:10:43 AM3/6/10
to spyder
Hi,

I've just tested the sample program (interactive console) submitted by
Rick in the first post on an up-to-date Ubuntu Karmic:
Python 2.6.4
Qt 4.5.2
PyQt 4.6

And it works...
Are you really using the official ubuntu packages?

-Pierre

Tim Michelsen

unread,
Mar 9, 2010, 6:13:21 PM3/9/10
to spyd...@googlegroups.com
Hi,
I just reinstalled Spyder but no effect.

here are my versions:

> Python 2.6.4
which python
/usr/bin/python
$ /usr/bin/python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
> Qt 4.5.2
ii libqt4-core 4.5.3really4.5.2-0ubuntu1
transitional package for Qt 4 core non-GUI runtime libraries

> PyQt 4.6
ii python-qt4 4.6-1
Python bindings for Qt4

>
> And it works...
> Are you really using the official ubuntu packages?

>>> from numpy import *
>>> from matplotlib import *
>>> from pylab import *
>>> x = linspace(0,5,100)
>>> y = sin(x)
>>> plot(x,y)

[<matplotlib.lines.Line2D object at 0xa97accc>]
>>> show()

### 2. try


>>> from numpy import *
>>> from matplotlib import *
>>> from pylab import *
>>> x = linspace(0,5,100)
>>> y = sin(x)
>>> plot(x,y)

[<matplotlib.lines.Line2D object at 0xaa02acc>]
>>> show()


Traceback (most recent call last):
File

"/usr/lib/pymodules/python2.6/matplotlib/backends/backend_qt4.py", line

Tim Michelsen

unread,
Apr 22, 2010, 4:56:18 PM4/22/10
to spyd...@googlegroups.com
> I just reinstalled Spyder but no effect.
I updated my HG working copy of Spyder today.

It works now.
I can run the plot script as many times as I want.

Great. Thanks for all your effort.

--
You received this message because you are subscribed to the Google Groups "spyder" group.
To post to this group, send email to spyd...@googlegroups.com.
To unsubscribe from this group, send email to spyderlib+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spyderlib?hl=en.

Reply all
Reply to author
Forward
0 new messages