# Python chaos

**URL:** <https://www.ruby-forum.com/t/python-chaos/237842>\
**Category:** GNU Radio\
**Created:** [December 3, 2013, 10:53am UTC](https://www.ruby-forum.com/t/python-chaos/237842 "2013-12-03T10:53:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [December 3, 2013, 10:53am UTC](https://www.ruby-forum.com/t/python-chaos/237842/1 "2013-12-03T10:53:58Z")

</div>

Hi,

I recently installed some stuff on my Opensuse 12.3, including gnuradio  
and QGis2.

When using QT widgets, Gnuradio GRC fails with

Traceback (most recent call last):  
File “/home/sgofferj/top\_block.py”, line 12, in   
from gnuradio import qtgui  
File “/usr/lib64/python2.7/site-packages/gnuradio/qtgui/ **init**.py”,  
line 34, in   
from qtgui\_swig import \*  
File  
“/usr/lib64/python2.7/site-packages/gnuradio/qtgui/qtgui\_swig.py”, line  
26, in   
\_qtgui\_swig = swig\_import\_helper()  
File  
“/usr/lib64/python2.7/site-packages/gnuradio/qtgui/qtgui\_swig.py”, line  
22, in swig\_import\_helper  
\_mod = imp.load\_module(’\_qtgui\_swig’, fp, pathname, description)  
ImportError: /usr/lib64/libgnuradio-qtgui-3.7.2.so.0.0.0: undefined  
symbol: \_ZN7QwtPlot17legendItemClickedEv

I don’t know anything about Python. Some googling pointed towards  
possible version conflicts but I can’t determine, what exactly is the  
problem. Could anyone bring light into the dark here?

-S

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [December 3, 2013, 3:52pm UTC](https://www.ruby-forum.com/t/python-chaos/237842/2 "2013-12-03T15:52:36Z")

</div>

On Tue, Dec 3, 2013 at 4:52 AM, Stefan Gofferje  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> File “/usr/lib64/python2.7/site-packages/gnuradio/qtgui/ **init**.py”,  
> ImportError: /usr/lib64/libgnuradio-qtgui-3.7.2.so.0.0.0: undefined  
> symbol: \_ZN7QwtPlot17legendItemClickedEv
> 
> I don’t know anything about Python. Some googling pointed towards  
> possible version conflicts but I can’t determine, what exactly is the  
> problem. Could anyone bring light into the dark here?
> 
> -S

You probably upgraded your system to use QT5, which won’t work with  
GNU Radio. See about finding a way to switch between QT4 and QT5 on  
your Suse system.

Tom

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [December 4, 2013, 9:20am UTC](https://www.ruby-forum.com/t/python-chaos/237842/3 "2013-12-04T09:20:09Z")

</div>

After some tinkering I am at this error message…:  
Traceback (most recent call last):  
File “/home/sgofferj/top\_block.py”, line 75, in   
tb = top\_block()  
File “/home/sgofferj/top\_block.py”, line 46, in **init**  
self.top\_layout.addWidget(self.\_qtgui\_freq\_sink\_x\_0\_win)  
File “/usr/lib64/python2.7/site-packages/gnuradio/gr/top\_block.py”,  
line 100, in **getattr**  
return getattr(self.\_tb, name)  
AttributeError: ‘top\_block\_sptr’ object has no attribute ‘top\_layout’

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [December 4, 2013, 9:34am UTC](https://www.ruby-forum.com/t/python-chaos/237842/4 "2013-12-04T09:34:46Z")

</div>

Hi Gofferje,

it might be trivial, but did you adjust the Generate Options? It should  
be set to “QT GUI” instead of the default “WX GUI”.

Johannes

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [December 4, 2013, 7:41am UTC](https://www.ruby-forum.com/t/python-chaos/237842/5 "2013-12-04T07:41:57Z")

</div>

On 12/03/2013 04:50 PM, Tom R. wrote:

> You probably upgraded your system to use QT5, which won’t work with  
> GNU Radio. See about finding a way to switch between QT4 and QT5 on  
> your Suse system.

Nope, no QT5 here.

I posted the same question on the opensuse mailinglist some time ago and  
Hans-Peter Jansen wrote:

* * *

The gnuradio app doesn’t match the installed qwt lib. Something changed  
in this area. I would check, which qwt version it is build against (on  
build service, in build log) and install exactly that one.

## Side note: I don’t know about gnuradio, but this TB points to some questionable concepts under its hood. The author is reinventing the wheel by wrapping qwt himself - with swig. The point is, qwt is wrapped already (called python-qwt5), and that’s done in a “sane” way, using python-sip - the same tool, that is used for python-qt{3,4} and python-kde{3,4} wraps…

But again, I don’t know anything about Python so I wouldn’t know how to  
diagnose the problem…

-S

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [December 4, 2013, 9:48am UTC](https://www.ruby-forum.com/t/python-chaos/237842/6 "2013-12-04T09:48:13Z")

</div>

On 12/04/2013 10:33 AM, Johannes D. wrote:

> it might be trivial, but did you adjust the Generate Options? It should  
> be set to “QT GUI” instead of the default “WX GUI”.

You are my hero! 😃  
Of course, I forgot that after hours of going through the installed  
packages on my system and trying to figure out which ones might conflict  
with GR :).

Thanks a lot.

-S

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [December 4, 2013, 10:51am UTC](https://www.ruby-forum.com/t/python-chaos/237842/7 "2013-12-04T10:51:20Z")

</div>

Well, joy was short… I added a QT GUI range item and…

Traceback (most recent call last):  
File “/home/sgofferj/top\_block.py”, line 16, in   
import PyQt4.Qwt5 as Qwt  
ImportError: No module named Qwt5

libqwt5 _is_ installed and there’s no “qwt5” package in any repo I know  
off…

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [December 4, 2013, 3:51pm UTC](https://www.ruby-forum.com/t/python-chaos/237842/8 "2013-12-04T15:51:45Z")

</div>

On Wed, Dec 4, 2013 at 4:49 AM, Stefan Gofferje  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Well, joy was short… I added a QT GUI range item and…
> 
> Traceback (most recent call last):  
> File “/home/sgofferj/top\_block.py”, line 16, in   
> import PyQt4.Qwt5 as Qwt  
> ImportError: No module named Qwt5
> 
> libqwt5 _is_ installed and there’s no “qwt5” package in any repo I know  
> off…

You must also have python-qwt5 (or PyQWT) installed to use these  
widgets.

And to respond to the above comment from the OpenSUSE mailing list you  
posted, this is /not/ reinventing the wheel. We are doing something  
completely different with Qwt than what PyQwt does to make all of the  
blocks work in C++. We make our own QWT widgets in C++ and then export  
those. But we also use PyQWT for things that are naturally supported  
there.

Plus, PyQWT has stopped development and has even stated that they will  
not support QWT6, which is a shame and will eventually cause us and  
anyone else trying to use PyQWT real issues in the future. I’ve been  
looking for an alternative to it.

Tom

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [May 7, 2014, 6:01am UTC](https://www.ruby-forum.com/t/python-chaos/237842/9 "2014-05-07T06:01:13Z")

</div>

The lack of notice for Generate Options is a killer. Not to mention, if  
using QT sinks with WX GUI set, a cryptic error message is the reuslt.

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [May 7, 2014, 9:32am UTC](https://www.ruby-forum.com/t/python-chaos/237842/10 "2014-05-07T09:32:03Z")

</div>

On 07.05.2014 05:59, Vanush V. wrote:

> The lack of notice for Generate Options is a killer. Not to mention, if  
> using QT sinks with WX GUI set, a cryptic error message is the reuslt.

We know, and we have this on our long todo list for GRC. We still don’t  
have an abundance of GRC devs, so don’t bet on this being done next  
week.

Martin

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [May 5, 2014, 12:21pm UTC](https://www.ruby-forum.com/t/python-chaos/237842/11 "2014-05-05T12:21:31Z")

</div>

Tom R.-2 wrote

> Plus, PyQWT has stopped development and has even stated that they will  
> not support QWT6, which is a shame and will eventually cause us and  
> anyone else trying to use PyQWT real issues in the future. I’ve been  
> looking for an alternative to it.

Will this affect gnuradio moving away from wxwidgets toward Qt ?

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/Python-chaos-tp45076p47953.html](http://gnuradio.4.n7.nabble.com/Python-chaos-tp45076p47953.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [May 7, 2014, 9:45am UTC](https://www.ruby-forum.com/t/python-chaos/237842/12 "2014-05-07T09:45:35Z")

</div>

Tom,

Have you looked at PyQtGraph? I’ve had some success with it.

Vanush

---

<div class="post-metadata">

**Author:** ![Stefan\_Gofferje](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Stefan\_Gofferje](https://www.ruby-forum.com/u/Stefan_Gofferje)\
**Post date:** [May 7, 2014, 3:31pm UTC](https://www.ruby-forum.com/t/python-chaos/237842/13 "2014-05-07T15:31:36Z")

</div>

On Wed, May 7, 2014 at 3:43 AM, Vanush V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Tom,
> 
> Have you looked at PyQtGraph? I’ve had some success with it.
> 
> Vanush

Thanks for the suggestion! Yes, I have looked at it. It looks like a  
great  
project for working directly in Python, but we mostly do all of our  
plotting in QT C++ and export. The use of PyQWT is specifically to get  
us  
QWT widgets like the range, check boxes, radio buttons, etc. Pretty much  
what you see under “GUI Tools → QT” in the GRC block list. It doesn’t  
look  
like PyQtGraph provides equivalents to those (or even anything that  
would  
effectively replace them).

Tom
