Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
m4ver1cks opened this issue May 8, 2020 · 4 comments
Open

Comments

@m4ver1cks
Copy link

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'

@g1nsj0h4n
Copy link

g1nsj0h4n commented Jul 14, 2021

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

@rootabeta
Copy link

rootabeta commented Jan 23, 2023

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/pythonmaster› 
$ 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'

@lonyelon
Copy link

lonyelon commented Feb 28, 2023

Easily solvable by running:

cmake .. -DCMAKE_INSTALL_PREFIX="/usr/"

Instead of cmake ...

@antonyenergy2
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants