# AttributeError: 'gr\_hier\_block2\_sptr' object has no attribute 'set\_callback'

**URL:** <https://www.ruby-forum.com/t/attributeerror-gr-hier-block2-sptr-object-has-no-attribute-set-callback/229940>\
**Category:** GNU Radio\
**Created:** [February 15, 2013, 3:27pm UTC](https://www.ruby-forum.com/t/attributeerror-gr-hier-block2-sptr-object-has-no-attribute-set-callback/229940 "2013-02-15T15:27:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanderkerkoff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/7feea3/32.png) [@vanderkerkoff](https://www.ruby-forum.com/u/vanderkerkoff)\
**Post date:** [February 15, 2013, 3:27pm UTC](https://www.ruby-forum.com/t/attributeerror-gr-hier-block2-sptr-object-has-no-attribute-set-callback/229940/1 "2013-02-15T15:27:57Z")

</div>

I am using using ubuntu 12.10 i am trying to run a python block, namely  
OP25, in GNU Radio Companion v3.6.3-35-g4435082f, which uses python  
version 2.7.3 for some reason although python3.3 is in the lib folder. I  
run the following command in terminal:

matt@matt-Inspiron-1525:~$ python -m trace --count -C . op25\_grc.py

Here is the output with an error:

Imported legacy fsk4  
Using Volk machine: ssse3\_32  
Traceback (most recent call last):  
File “/usr/lib/python2.7/runpy.py”, line 162, in \_run\_module\_as\_main  
“ **main** ”, fname, loader, pkg\_name)  
File “/usr/lib/python2.7/runpy.py”, line 72, in \_run\_code  
exec code in run\_globals  
File “/usr/lib/python2.7/trace.py”, line 819, in   
main()  
File “/usr/lib/python2.7/trace.py”, line 807, in main  
t.runctx(code, globs, globs)  
File “/usr/lib/python2.7/trace.py”, line 513, in runctx  
exec cmd in globals, locals  
File “op25\_grc.py”, line 493, in   
tb = op25\_grc()  
File “op25\_grc.py”, line 231, in **init**  
self.wxgui\_fftsink2\_0\_0.set\_callback(wxgui\_fftsink2\_0\_0\_callback)  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier\_block2.py”,  
line 54, in **getattr**  
return getattr(self.\_hb, name)  
AttributeError: ‘gr\_hier\_block2\_sptr’ object has no attribute  
‘set\_callback’

the code for “hier\_block2.py” is attached. have not been able to find  
any sort of solution for this. any help will be much appreciated.  
Thank you!
