Gnuradio 3.8 and gr-limesdr: No module named 'limesdr'

Hi!
I am running Ubuntu 18.04 with Gnuradio 3.8.1.0 and the latest version of gr-limesdr (compiled from the GR 3.8 branch).
When i run the FM_receiver example, or any other flowchart containing the limesdr module, i get this error:

 <<< Welcome to GNU Radio Companion 3.8.1.0 >>>

Block paths:
	/usr/share/gnuradio/grc/blocks
	/usr/local/share/gnuradio/grc/blocks

Loading: "/home/pc/gr-limesdr/examples/FM_receiver.grc"
>>> Done

Generating: '/home/pc/gr-limesdr/examples/top_block.py'

Executing: /usr/bin/python3 -u /home/pc/gr-limesdr/examples/top_block.py

Traceback (most recent call last):
  File "/home/pc/gr-limesdr/examples/top_block.py", line 40, in <module>
    import limesdr
ModuleNotFoundError: No module named 'limesdr'

>>> Done (return code 1)

I’ve tried setting the $PYTHONPATH variable to the right directory but no difference.

I really don’t want to go back to GR 3.7, any idea?

I just found this yesterday in the github for gr-limesdr, which was last updated less than a month ago, “Doesn’t compile with GNU Radio 3.8.”.

The solution is not to use the default master branch (which is only for gr-3.7) but to use the gr-3.8 branch :
git checkout gr-3.8 (ref: https://github.com/myriadrf/gr-limesdr/issues/60 )

Thank you for your answer but as i said i compiled gr-limesdr from the gr-3.8 branch.

Sorry I missed that. Did you install everything from source code ? or was it packages for everything and only gr-limesdr from source ?

The error message above to me suggests that gnuradio does not know about the limesdr at all.

Were you following this set of instructions https://wiki.myriadrf.org/Gr-limesdr_Plugin_for_GNURadio or some other set ?

I installed limesuite and gnuradio from PPA and compiled gr-limesdr from source.

Also Python in general doesn’t know about limesdr and where to find it.

I pretty much tried every combination of installing from PPA and compiling.

Thank you

Hi @alex250491,

You need to add the directory where the gr-limesdr module is installed to the PYTHONPATH environment variable

export PYTHONPATH=/usr/local/lib/python3/dist-packages/:$PYTHONPATH
/home/pc/gr-limesdr/examples/top_block.py'

To make this permanent add the export line to your ~/.profile and logout and login again.

2 Likes

This works, thank you.
I really don’t understand why i’m the only one with this problem.

I generally install everything from source and have had no problems at all. And I’ve always had problems when I tried to use packages and source. But @vvvelichkov’s post taught me that historically my issues was caused by not updating PYTHONPATH, something that I did not think about. Usually I just need to add something to my PATH and/or LD_LIBRARY_PATH to get things to work if something is not found.

You are definitely not the only one, see

It’s quite common problem with gnuradio 3.8 as the directory where the OOT modules gets installed when installed from source is not in the default python module search path (sys.path)

I also have problem with gr-limesdr module for gnuradio 3.8.2
I also build the module from source. Gnuradio find the module but it does not see the limesdr mini connected. The limesdr-mini is seen from LimeSuitGUI and from LimeUtil --find

The error i have launching a simple flowgraph (LimeRX source and frequency sync) is

Blockquote
File “/home/fabio/Documenti/limeSDR.py”, line 117, in init
self.limesdr_source_0 = limesdr.source(‘1D3ACA41C50D05’, 0, ‘’)
AttributeError: module ‘limesdr’ has no attribute ‘source’

Hi @fcapozzi,

Have you updated gnuradio or limesuite recently (after building and installing gr-limesdr)?

Most probably there are undefined symbols in _limesdr_swig.so so try rebuilding and reinstalling gr-limesdr again. If it still does not work provide the full output of

ldd -r  /usr/local/lib/python3/dist-packages/limesdr/_limesdr_swig.so

Hi, tnx for answer, i found the file you referred but it is located in

/usr/lib/python3.8/site-packages/limesdr/_limesdr_swig.so

the ldd -r commands reports :

[fabio-pc /]# ldd -r /usr/lib/python3.8/site-packages/limesdr/_limesdr_swig.so
linux-vdso.so.1 (0x00007ffff2149000)
libgnuradio-limesdr.so.3.1.2 => not found
libpython3.8.so.1.0 => /usr/lib/libpython3.8.so.1.0 (0x00007f2702fc4000)
libgnuradio-runtime.so.3.8.0 => /usr/lib/libgnuradio-runtime.so.3.8.0 (0x00007f2702ec4000)
libgnuradio-pmt.so.3.8.0 => /usr/lib/libgnuradio-pmt.so.3.8.0 (0x00007f2702e58000)
libvolk.so.2.2.1 => /usr/lib/libvolk.so.2.2.1 (0x00007f27029c7000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f27029c2000)
liborc-0.4.so.0 => /usr/lib/liborc-0.4.so.0 (0x00007f270293e000)
libboost_program_options.so.1.72.0 => /usr/lib/libboost_program_options.so.1.72.0 (0x00007f27028af000)
libboost_filesystem.so.1.72.0 => /usr/lib/libboost_filesystem.so.1.72.0 (0x00007f270288f000)
libboost_system.so.1.72.0 => /usr/lib/libboost_system.so.1.72.0 (0x00007f270288a000)
libboost_regex.so.1.72.0 => /usr/lib/libboost_regex.so.1.72.0 (0x00007f2702789000)
libboost_thread.so.1.72.0 => /usr/lib/libboost_thread.so.1.72.0 (0x00007f270275d000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f2702739000)
liblog4cpp.so.5 => /usr/lib/liblog4cpp.so.5 (0x00007f27026f5000)
libgmpxx.so.4 => /usr/lib/libgmpxx.so.4 (0x00007f27026ec000)
libgmp.so.10 => /usr/lib/libgmp.so.10 (0x00007f270264b000)
librt.so.1 => /usr/lib/librt.so.1 (0x00007f2702640000)
libLimeSuite.so.20.01-1 => /usr/lib/libLimeSuite.so.20.01-1 (0x00007f270256b000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f2702380000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f270223a000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f2702220000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f270205a000)
libutil.so.1 => /usr/lib/libutil.so.1 (0x00007f2702055000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f270342e000)
libicudata.so.65 => /usr/lib/libicudata.so.65 (0x00007f27005a2000)
libicui18n.so.65 => /usr/lib/libicui18n.so.65 (0x00007f27002af000)
libicuuc.so.65 => /usr/lib/libicuuc.so.65 (0x00007f27000cd000)
libnsl.so.2 => /usr/lib/libnsl.so.2 (0x00007f27000b3000)
libusb-1.0.so.0 => /usr/lib/libusb-1.0.so.0 (0x00007f2700097000)
libtirpc.so.3 => /usr/lib/libtirpc.so.3 (0x00007f2700066000)
libudev.so.1 => /usr/lib/libudev.so.1 (0x00007f270003b000)
libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00007f26fffe6000)
libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00007f26fff01000)
libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00007f26ffed0000)
libcom_err.so.2 => /usr/lib/libcom_err.so.2 (0x00007f26ffeca000)
libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00007f26ffeb9000)
libkeyutils.so.1 => /usr/lib/libkeyutils.so.1 (0x00007f26ffeb2000)
libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007f26ffe99000)
undefined symbol: ZN2gr7limesdr4sink4makeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiRKS7_S9 (/usr/lib/python3.8/site-packages/limesdr/_limesdr_swig.so)
undefined symbol: ZN2gr7limesdr6source4makeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiRKS7 (/usr/lib/python3.8/site-packages/limesdr/_limesdr_swig.so)

It seems that libgnuradio-limesdr is not found.

My Linux distribution is Manjaro (based on Arch linux) and i installed GnuRadio and LimeSuite via paceman manager. The gr-limesdr module was missing in paceman so i copied the git repository, checked out the gr-3.8 branch, compile and installed.

tnx for help !
Fabio.

I’m not familiar with Arch/Manjaro but it looks that /usr/local/lib is not in the default library search paths on these distributions. First check that libgnuradio-limesdr.so.3.1.2 is actually installed there and add it to the search path.

sudo su -
echo '/usr/local/lib' > /etc/ld.so.conf.d/usrlocal.conf
ldconfig

See also why is /usr/local/lib not in ld.so.conf? / Applications & Desktop Environments / Arch Linux Forums

Hi, tnx for you help. I solved the problem. First i found that the library is located here

/usr/local/lib/libgnuradio-limesdr.so.3.1.2

but all other system libraries are located in /usr/lib and this is the search path.
Since i do not want to alter default library search path because some other dependencies may probably rely on this path i simply added a symbolic link from /usr/lib to /usr/local/lib with the same library name.
So now the ldd -r listing found all dependencies and gr-limesdr module works.

Now we should understand why the configure, make, make install scripts does not recognised the right path to be used in the system. i did the compile with this command sequence from the source repos

git checkout gr-3.8
mkdir build
cd build
cmake …/
make
sudo make install

In my opinion the cmake configurator should detect the environment of the system and modify its installation path accordingly. May be something have to be checked in the CMakefile script.

Hope this will help others.
Tnx again for your valuable help !!!

If you really want to install in /usr/ instead of /usr/loacal (I do not recommend doing this) then execute

cd build
sudo make uninstall
rm CMakeCache.txt
cmake -D CMAKE_INSTALL_PREFIX=/usr/ ..
make
sudo make install

From Filesystem Hierarchy Standard

The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated.

Locally installed software must be placed within /usr/local rather than /usr unless it is being installed to replace or upgrade software in /usr.

Software placed in / or /usr may be overwritten by system upgrades (though we recommend that distributions do not overwrite data in /etc under these circumstances). For this reason, local software must not be placed outside of /usr/local without good reason.

1 Like