gr-dsd icon indicating copy to clipboard operation
gr-dsd copied to clipboard

AttributeError: type object 'dsd' has no attribute 'dsd_block_ff'

Open m4ver1cks opened this issue 5 years ago • 4 comments

When I try to use the block with Gnuradio 3.8 (In manjaro and Ubuntu) the program throw the following error.

Traceback (most recent call last): File "/home/user/pruebas/dsd/dsd.py", line 211, in main() File "/home/user/pruebas/dsd/dsd.py", line 189, in main tb = top_block_cls() File "/home/user/pruebas/dsd/dsd.py", line 142, in init self.dsd_block_ff_0 = dsd.dsd_block_ff(dsd.dsd_FRAME_AUTO_DETECT,dsd.dsd_MOD_AUTO_SELECT,3,True,2) AttributeError: type object 'dsd' has no attribute 'dsd_block_ff'

m4ver1cks avatar May 08 '20 17:05 m4ver1cks

You need to make changes as mentioned in #https://github.com/szechyjs/dsd/issues/104

  • make exitflag "extern" in dsd/include/dsd.h
  • declare "int exitflag = 0;" in dsd/src/dsd_main.h before the comp function

You can test its working after build by running "build/python/qa_dsd_block_ff_test.sh" It should report like this:

.
----------------------------------------------------------------------
Ran 1 test in 0.001s

OK

g1nsj0h4n avatar Jul 14 '21 20:07 g1nsj0h4n

You need to make changes as mentioned in #szechyjs/dsd#104

* make exitflag "extern" in dsd/include/dsd.h

* declare "int exitflag = 0;" in dsd/src/dsd_main.h before the comp function

You can test its working after build by running "build/python/qa_dsd_block_ff_test.sh" It should report like this:

.
----------------------------------------------------------------------
Ran 1 test in 0.001s

OK

I'm not convinced this is the solution. To me, this looks like an issue with the dsd module that's bundled with gr-dsd. Depending on path, dsd fails to import at all, and when it succeed, it fails to import the functions that it should. My guess is that qr-dsd seems to compile its own python library during build, which then isn't successfully loaded into the python runtime.

rootabeta@netrunner ~/Tools/gr-dsd/python ‹master› 
$ python3 qa_dsd_block_ff.py 
Traceback (most recent call last):
  File "/home/rootabeta/Tools/gr-dsd/python/qa_dsd_block_ff.py", line 12, in <module>
    from dsd import dsd_block_ff
ModuleNotFoundError: No module named 'dsd'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rootabeta/Tools/gr-dsd/python/qa_dsd_block_ff.py", line 18, in <module>
    from dsd import dsd_block_ff
ModuleNotFoundError: No module named 'dsd'

rootabeta avatar Jan 23 '23 13:01 rootabeta

Easily solvable by running:

cmake .. -DCMAKE_INSTALL_PREFIX="/usr/"

Instead of cmake ...

lonyelon avatar Feb 28 '23 19:02 lonyelon

I had same issue. I set name of project to "dsd". So when i run it i get dsd.py created and import dsd will import it istead of correct module. From what I see your file name is also dsd.py Create new project and name it differently.

antonyenergy2 avatar Jan 20 '24 23:01 antonyenergy2