Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'output': 0.04; 'attribute': 0.05; 'error:': 0.05; 'method.': 0.05; 'modify': 0.05; 'much!': 0.05; 'skip:" 60': 0.05; '__name__': 0.07; 'exec': 0.07; 'main()': 0.07; "subject:' ": 0.07; 'suppose': 0.07; 'python': 0.09; 'cmd': 0.09; 'confuse': 0.09; 'defined.': 0.09; 'imported': 0.09; 'name)': 0.09; 'referenced': 0.09; 'software;': 0.09; 'subject:GNU': 0.09; 'subject:module': 0.09; 'suggest': 0.11; "hasn't": 0.15; 'stack': 0.15; '2.7.3': 0.16; '54,': 0.16; 'fname,': 0.16; 'folder.': 0.16; 'jumped': 0.16; 'jumps': 0.16; 'mixture': 0.16; 'subject:object': 0.16; 'url.': 0.16; 'wrote:': 0.17; 'fix': 0.17; 'version.': 0.17; 'foundation,': 0.18; 'code,': 0.18; 'feb': 0.19; 'module': 0.19; 'skip:" 30': 0.20; 'sort': 0.21; 'trying': 0.21; 'supposed': 0.21; 'large,': 0.22; 'trace': 0.22; 'help.': 0.22; 'posted': 0.22; "i'd": 0.22; 'somebody': 0.23; 'command': 0.24; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'skip:" 20': 0.26; 'wondering': 0.26; 'appreciated.': 0.26; '(most': 0.27; 'done.': 0.27; 'skip:# 10': 0.27; 'skip:s 60': 0.27; "doesn't": 0.28; 'there.': 0.28; 'lines': 0.28; 'run': 0.28; 'block,': 0.29; 'surprised': 0.29; 'included': 0.29; 'source': 0.29; 'class': 0.29; "i'm": 0.29; "skip:' 10": 0.30; 'that.': 0.30; 'query': 0.30; 'error': 0.30; 'code': 0.31; 'file': 0.32; "skip:' 20": 0.32; 'legacy': 0.33; 'traceback': 0.33; 'ubuntu': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'version': 0.34; 'wrong': 0.34; 'pm,': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'flow': 0.36; "didn't": 0.36; 'should': 0.36; 'thank': 0.36; 'unable': 0.36; 'does': 0.37; 'uses': 0.37; 'why': 0.37; 'skip:v 20': 0.37; 'quite': 0.37; 'rather': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'comment': 0.38; 'object': 0.38; 'supports': 0.38; 'some': 0.38; 'nothing': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'where': 0.40; 'skip:" 10': 0.40; 'received:192.168': 0.40; 'help': 0.40; 'your': 0.60; 'first': 0.61; 'latest': 0.61; 'free': 0.61; 'email addr:gmail.com': 0.63; 'here': 0.65; 'generated.': 0.65; 'received:74.208': 0.71; 'goal': 0.74; 'subject:skip:A 10': 0.75; '2013': 0.84; 'anywhere.': 0.84; 'locals': 0.84; 'received:74.208.4.194': 0.84; 'subject:running': 0.84; 'subject:skip:g 10': 0.84 Date: Sat, 16 Feb 2013 00:24:45 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Exception running GNU module "op25_grc.py" : AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback' References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:SRfiQRG0Fl+rnIi5asJee2dqSRrgU0y3LIuPueXGBeF X1R5bCQaZzHKsfmtH2IoqfPi8gX9r1xSC0YwWFCnYYZWYT+flU ZP5CvrCHpIxyrPXF+jC2Mq62wYfq/85B4Damqiggm+EFDNJyrF gIG4dbIlugUAkaV+5izPgrOFa8joJwbwPDNMnI/8LGINV31MXm KtY8Jq19McVE48ecEuvPj2XfV1ueimQ1Wvc4apQeydnLCe6I2z ww0K8zfz6R3k7IT6H+7xdj3Tn3m7at/xb7fbbr5rNNL6uWfY78 wSTtH7FR7ZTma15sp7WN9PaNb3osMgev1qu9oCoANsrY9NitA= = X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 87 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360992301 news.xs4all.nl 6852 [2001:888:2000:d::a6]:60769 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38995 On 02/15/2013 02:00 PM, matt.doolittle33@gmail.com wrote: > 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.2 is in the lib folder. I run the following trace command in terminal: > > ~$ 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 "op25_grc.py": > > #!/usr/bin/env python > ################################################## > # Gnuradio Python Flow Graph > # Title: Op25 Grc > # Generated: Wed Feb 13 19:37:41 2013 > ################################################## > > > > and the code from "hier_block2_.py": > > # > # Copyright 2006,2007 Free Software Foundation, Inc. > # > # This file is part of GNU Radio > # > # GNU Radio is free software; you can redistribute it and/or modify > > > > > My goal is to fix the error: AttributeError: "'gr_hier_block2_sptr' object has no attribute 'set_callback'" so that the block "op25_grc.py" will run in GNU radio companion. > > i have been unable to find any sort of solution to this problem anywhere. some have said its a version problem with GNUradio but as i posted above i have the latest version. > > Any help will be greatly appreciated. Thank you very much! > I'm rather surprised somebody hasn't jumped in by now. I thought your reworded query was quite well done. One of the source files is pretty large, but it's not your code, so that perhaps cannot be helped. I'm not sure why you included the code from hier_block2_.py, as I cannot see any reference to it. I'm surprised at the comment in the first file that said the code was generated. if it was generated by your efforts, perhaps there was something wrong with that. I know nothing about this gnuradio thingie, and you didn't supply a website url. I was wondering if the module is even intended to be run standalone, but I suppose the if __name__ == "__main__" thing is a clue that it's supposed to. I found the mixture of trace lines to confuse the stack trace immensely, since the exception doesn't occur in the last source line quoted. Somebody better than I had best jump in and help. The error message referenced class gr_hier_block2_sptr, but I don't see where this is defined. So I'm not sure how to tell whether it does or should have a set_callback method. If nobody else jumps in, I'd suggest finding a forum that supports gnuradio, and ask there. -- DaveA