ImportError: No module named _uhd_swig

251 views
Skip to first unread message

alireza nazari

unread,
Oct 30, 2019, 11:39:38 PM10/30/19
to Pothos Users
Hi,

I am using GNURadio from PothosSDR on Windows. When I run my grc file in gnuradio, it runs correctly. However when I run it in command prompt I get this error:

E:\Alireza\sdr_A20\4channel\recorder>recorder_grc.py
Traceback (most recent call last):
  File "E:\Alireza\sdr_A20\4channel\recorder\recorder_grc.py", line 12, in <module>
    from gnuradio import uhd
  File "E:\Program Files\PothosSDR\lib\python2.7\site-packages\gnuradio\uhd\__init__.py", line 135, in <module>
    _prepare_uhd_swig()
  File "E:\Program Files\PothosSDR\lib\python2.7\site-packages\gnuradio\uhd\__init__.py", line 38, in _prepare_uhd_swig
    import uhd_swig
  File "E:\Program Files\PothosSDR\lib\python2.7\site-packages\gnuradio\uhd\uhd_swig.py", line 17, in <module>
    _uhd_swig = swig_import_helper()
  File "E:\Program Files\PothosSDR\lib\python2.7\site-packages\gnuradio\uhd\uhd_swig.py", line 16, in swig_import_helper
    return importlib.import_module('_uhd_swig')
  File "E:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named _uhd_swig

Anybody knows what can be wrong? I thought it's a path issue but it looks like my PYTHONPATH is pointing to "E:\Program Files\PothosSDR\lib\python2.7\site-packages" which looks correct. 



alireza nazari

unread,
Nov 1, 2019, 2:33:30 AM11/1/19
to Pothos Users
I also realized "import uhd" doesn't find the module. I assume gnuradio in PothosSDR is using uhd python APIs, otherwise gnu companion couldn't run my grc file. But I don't know where python APIs are to add them to the path. I hope this solves the problem. 

Josh Blum

unread,
Nov 2, 2019, 9:01:40 AM11/2/19
to pothos...@googlegroups.com

Sometimes the python imports fail when the actual underlying DLL cannot be loaded.

So its possible that uhd.dll cannot be found in $PATH or perhaps a DLL needed by uhd.dll cannot be found

Double check that E:\Program Files\PothosSDR\bin is in your $PATH

You can also open uhd.dll or _uhd_swig.dll in a program called dependency walker, it can show you which dlls cannot be found.

Hope that helps,

-josh

--
You received this message because you are subscribed to the Google Groups "Pothos Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pothos-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pothos-users/499c8fa5-dccc-4d11-8275-6ad514b42fb1%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages