[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] AttributeError: 'module' object has no attribute
From: |
Martin Braun (CEL) |
Subject: |
Re: [Discuss-gnuradio] AttributeError: 'module' object has no attribute 'square3_ff' |
Date: |
Tue, 29 Oct 2013 16:38:01 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi Tarik,
On Tue, Oct 29, 2013 at 04:43:53PM +0200, Aydin Tarik Zengin wrote:
> I'm getting an error while adding a new block to grc version
> 3.7.2git-110-gb8b9bff2.
> I followed the tutorial at http://gnuradio.org/redmine/projects/gnuradio/wiki/
> OutOfTreeModules
>
> Also had to modify at some points as below.
> - in the test code it worked when I changed ;
>
> from gnuradio import gr, gr_unittest into from gnuradio import gr,
> gr_unittest,
> blocks
Thanks, there were some references to GNU Radio 3.6-style blocks. I've
updated the tutorial to reflect that.
> All the tests pass too.
> 100% tests passed, 0 tests failed out of 2
Did you add a test for the Python block? (Perhaps there's a problem
in the Python, which would show up here).
> I added 3 blocks using c++ for first 2 and python for the last as explained in
> the tutorial.
> I can see the blocks in the grc block list and can add them into the sketch.
> It generates the python code without any error.
> But the generated python code cannot be run and giving the error below:
>
> Traceback (most recent call last):
> File "top_block.py", line 82, in <module>
> tb = top_block()
> File "top_block.py", line 48, in __init__
> self.test_square3_ff_0 = test.square3_ff()
> AttributeError: 'module' object has no attribute 'square3_ff'
>
> You can see the generated file from http://pastebin.com/nE4SFn8Y
>
> test module is placed under /usr/lib/python2.7/site-packages/test
> gnuradio is under /usr/lib/python2.7/site-packages/gnuradio
>
> Is there any point in the tutorial that does not match with the current
> version
> of gnuradio?
Yes there is, but I'm not sure that's the problem. I couldn't replicate
your problem, however.
Make sure
- your Python block works correctly (unit test it)
- the XML definition for the GRC block is correct
- everything is installed correctly.
Perhaps you want to go over the tutorial with the updated info again.
MB
--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)
Dipl.-Ing. Martin Braun
Research Associate
Kaiserstraße 12
Building 05.01
76131 Karlsruhe
Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu
KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association
pgpx6YFmOV7df.pgp
Description: PGP signature