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

ImportError: No module named dsd_swig #52

Closed
mattia-beta opened this issue Aug 28, 2016 · 2 comments
Closed

ImportError: No module named dsd_swig #52

mattia-beta opened this issue Aug 28, 2016 · 2 comments

Comments

@mattia-beta
Copy link

Hi, i've just built gr-dsd from source but the DSD demodulator is not showing inside shinysdr.
Looking at the source code I've found this snippet:

try:
from dsd import block_ff as dsd_block_ff
_available = True
except ImportError:
_available = False

I think the problem is that shinysdr can't find the dsd python module.
I've manually tried to import this module inside a python script but I got this error:

from dsd import block_ff as dsd_block_ff
Traceback (most recent call last):
File "", line 1, in
File "**/usr/lib/python2.7/dist-packages/**dsd/init.py", line 45, in
from dsd_swig import *
ImportError: No module named dsd_swig

I've also checked the PYTHON_PATH running:
python -c "import sys; print '\n'.join(sys.path)"

and the response is:

/usr/local/lib/python2.7/dist-packages/ShinySDR-0.0.0-py2.7.egg
/usr/local/lib/python2.7/dist-packages/ephem-3.7.6.0-py2.7-linux-armv7l.egg
/usr/local/lib/python2.7/dist-packages/txWS-0.9.1-py2.7.egg
/usr/local/lib/python2.7/dist-packages/Twisted-16.3.2-py2.7-linux-armv7l.egg
/usr/local/lib/python2.7/dist-packages/zope.interface-4.2.0-py2.7-linux-armv7l.egg
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7
/usr/lib/python2.7/plat-arm-linux-gnueabihf
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/PILcompat
/usr/lib/python2.7/dist-packages/gtk-2.0
/usr/lib/pymodules/python2.7
/usr/lib/python2.7/dist-packages/wx-3.0-gtk2

Searching for "gr-dsd" in the filesystem:

/usr/lib/libgr-dsd.so
/usr/local/lib/libgr-dsd.so

Any idea?
How can I fix this error?
Thank you =)

@kpreid
Copy link
Owner

kpreid commented Aug 28, 2016

I'm afraid I don't have any advice for Python SWIG issues — and as you've already figured out, this is a problem with installing gr-dsd and not ShinySDR per se. Sorry!

(But if you figure it out, let me know — I'm thinking of putting together a “troubleshooting” section of the manual.)

@kpreid kpreid closed this as completed Aug 28, 2016
@mattia-beta
Copy link
Author

@kpreid I've fixed this issue doing:

cmake . -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpyglib-2.0-python2.7.so.0

make

sudo make install

sudo ldconfig

Otherwise _dsd_swig.so is built and linked against libpython3.5m.so, leading to the following error on "import dsd": dynamic module does not define init function (init_dsd_swig)

Bye

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

2 participants