BogdanDIA/gr-dvbt

ImportError: No module named dvbt_swig

VigibotDev opened this issue · 3 comments

Hello,
I can't deal with this issue:( don't understand python "swig", I tested swig and swig3.0 from debian repo with same issue.

linux; GNU C++ version 4.9.1; Boost_105500; UHD_003.007.003-0-unknown

Traceback (most recent call last):
  File "/root/gr-dvbt/apps/top_block.py", line 23, in <module>
    import dvbt
  File "/usr/lib/python2.7/dist-packages/dvbt/__init__.py", line 45, in <module>
    from dvbt_swig import *
ImportError: No module named dvbt_swig

>>> Done
# Temporary workaround for ticket:181 (swig+python problem)
import sys
_RTLD_GLOBAL = 0
try:
    from dl import RTLD_GLOBAL as _RTLD_GLOBAL
except ImportError:
    try:
        from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL
    except ImportError:
        pass

if _RTLD_GLOBAL != 0:
    _dlopenflags = sys.getdlopenflags()
    sys.setdlopenflags(_dlopenflags|_RTLD_GLOBAL)
# ----------------------------------------------------------------


# import swig generated symbols into the dvbt namespace
from dvbt_swig import *

Yo @serveurperso. This happened to me too - if you've installed swig you just need to re-compile the whole application and it should work. It's probably an issue that compilation succeeds without errors if you don't have swig installed, when in fact it makes the python libs unusable... :)

i had same problem,i installed swig,apt-get install swig.and i again maked gr-dvbt gain,and my problem is solved.

Thank @stackprogramer 👍
It works like a charm:
First, IF you run cmake without SWIG installed, there are warnings:
-- Checking for module SWIG
-- Disabling SWIG because version check failed.
after installing SWIG as @stackprogramer mentioned, it should be showing as:
-- Checking for module SWIG
-- Found SWIG version 3.0.12.
-- Found SWIG: /usr/bin/swig3.0

And my codes working just fine!