# AttributeError while executing a simple example

**URL:** <https://www.ruby-forum.com/t/attributeerror-while-executing-a-simple-example/237504>\
**Category:** GNU Radio\
**Created:** [November 16, 2013, 3:03pm UTC](https://www.ruby-forum.com/t/attributeerror-while-executing-a-simple-example/237504 "2013-11-16T15:03:40Z")\
**Posts on this page:** 2\
**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:** [November 16, 2013, 3:03pm UTC](https://www.ruby-forum.com/t/attributeerror-while-executing-a-simple-example/237504/1 "2013-11-16T15:03:40Z")

</div>

HI,

I had installed GNU Radio recently and tried to execute a simple example  
as  
shown in the image below. But it throws me the following error. I  
referred  
various sources and I came to a guessing conclusion that this would be  
an  
issue with installation. But I am sure, everything went right during  
installing. I am not able to figure out what and where it went wrong.  
Kindly  
help!

Error:

Traceback (most recent call last):  
File “/home/vishnu/top\_block.py”, line 85, in   
tb = top\_block()  
File “/home/vishnu/top\_block.py”, line 48, in **init**  
self.top\_layout.addWidget(self.\_qtgui\_freq\_sink\_x\_0\_win)  
File  
“/usr/local/lib/python2.7/dist-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’

[http://gnuradio.4.n7.nabble.com/file/n44755/flow\_graph.jpg](http://gnuradio.4.n7.nabble.com/file/n44755/flow_graph.jpg)

Is the error due to the GUI component as I don’t get the error when I  
execute other simple example using audio source, throttle and a audio  
sink.  
Could anyone give me an idea where would be the issue?

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/AttributeError-while-executing-a-simple-example-tp44755.html](http://gnuradio.4.n7.nabble.com/AttributeError-while-executing-a-simple-example-tp44755.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Rikhu\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4bbf92/32.png) [@Rikhu\_P](https://www.ruby-forum.com/u/Rikhu_P)\
**Post date:** [November 16, 2013, 3:27pm UTC](https://www.ruby-forum.com/t/attributeerror-while-executing-a-simple-example/237504/2 "2013-11-16T15:27:02Z")

</div>

On Sat, Nov 16, 2013 at 9:02 AM, Rikhu P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> [http://gnuradio.4.n7.nabble.com/file/n44755/flow\_graph.jpg](http://gnuradio.4.n7.nabble.com/file/n44755/flow_graph.jpg)
> 
> Is the error due to the GUI component as I don’t get the error when I  
> execute other simple example using audio source, throttle and a audio sink.  
> Could anyone give me an idea where would be the issue?

It’s likely that you have the “Generate Options” in the “Options”  
block set wrong (probably to WX GUI) while you are trying to use a  
QTGUI sink. Change that option to “QT GUI” and you should be fine.

Tom
