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

**URL:** <https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970>\
**Category:** LimeSDR\
**Created:** [9 April 2020 20:33 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970 "2020-04-09T20:33:19Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex250491](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/alex250491/32/1560_2.png) [@alex250491](https://discourse.myriadrf.org/u/alex250491)\
**Post date:** [9 April 2020 20:33 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/1 "2020-04-09T20:33:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mzs](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/mzs/32/2678_2.png) [@mzs](https://discourse.myriadrf.org/u/mzs)\
**Post date:** [9 April 2020 21:30 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/2 "2020-04-09T21:30:27Z")

</div>

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.”](https://github.com/myriadrf/gr-limesdr/blob/master/docs/known_issues.txt).

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](https://github.com/myriadrf/gr-limesdr/issues/60) )

---

<div class="post-metadata">

**Author:** ![alex250491](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/alex250491/32/1560_2.png) [@alex250491](https://discourse.myriadrf.org/u/alex250491)\
**Post date:** [10 April 2020 08:17 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/3 "2020-04-10T08:17:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mzs](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/mzs/32/2678_2.png) [@mzs](https://discourse.myriadrf.org/u/mzs)\
**Post date:** [10 April 2020 10:34 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/4 "2020-04-10T10:34:43Z")

</div>

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](https://wiki.myriadrf.org/Gr-limesdr_Plugin_for_GNURadio) or some other set ?

---

<div class="post-metadata">

**Author:** ![alex250491](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/alex250491/32/1560_2.png) [@alex250491](https://discourse.myriadrf.org/u/alex250491)\
**Post date:** [10 April 2020 16:29 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/5 "2020-04-10T16:29:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vvvelichkov](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/vvvelichkov/32/2844_2.png) [@vvvelichkov](https://discourse.myriadrf.org/u/vvvelichkov)\
**Post date:** [10 April 2020 17:21 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/6 "2020-04-10T17:21:12Z")

</div>

Hi @alex250491,

> [@alex250491](#):
>
> ModuleNotFoundError: No module named ‘limesdr’

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![alex250491](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/alex250491/32/1560_2.png) [@alex250491](https://discourse.myriadrf.org/u/alex250491)\
**Post date:** [10 April 2020 20:54 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/7 "2020-04-10T20:54:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mzs](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/mzs/32/2678_2.png) [@mzs](https://discourse.myriadrf.org/u/mzs)\
**Post date:** [10 April 2020 21:01 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/8 "2020-04-10T21:01:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vvvelichkov](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/vvvelichkov/32/2844_2.png) [@vvvelichkov](https://discourse.myriadrf.org/u/vvvelichkov)\
**Post date:** [10 April 2020 21:03 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/9 "2020-04-10T21:03:51Z")

</div>

> [@alex250491](#):
>
> I really don’t understand why i’m the only one with this problem.

You are definitely not the only one, see

- [ModuleNotFoundError: No module named 'limesdr'](https://discourse.myriadrf.org/t/modulenotfounderror-no-module-named-limesdr/5561)
- [python - ModuleNotFoundError on GNU Radio right after installation - Stack Overflow](https://stackoverflow.com/questions/60792169/modulenotfounderror-on-gnu-radio-right-after-installation/60793166#60793166),
- [gnuradio error · Issue #480 · ptrkrysik/gr-gsm · GitHub](https://github.com/ptrkrysik/gr-gsm/issues/480#issuecomment-532305188)

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`)

---

<div class="post-metadata">

**Author:** ![fcapozzi](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@fcapozzi](https://discourse.myriadrf.org/u/fcapozzi)\
**Post date:** [20 April 2020 20:44 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/10 "2020-04-20T20:44:35Z")

</div>

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’

---

<div class="post-metadata">

**Author:** ![vvvelichkov](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/vvvelichkov/32/2844_2.png) [@vvvelichkov](https://discourse.myriadrf.org/u/vvvelichkov)\
**Post date:** [21 April 2020 14:32 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/11 "2020-04-21T14:32:41Z")

</div>

Hi @fcapozzi,

> [@fcapozzi](#):
>
> > 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’

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

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

```

---

<div class="post-metadata">

**Author:** ![fcapozzi](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@fcapozzi](https://discourse.myriadrf.org/u/fcapozzi)\
**Post date:** [21 April 2020 22:39 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/12 "2020-04-21T22:39:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vvvelichkov](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/vvvelichkov/32/2844_2.png) [@vvvelichkov](https://discourse.myriadrf.org/u/vvvelichkov)\
**Post date:** [21 April 2020 23:31 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/13 "2020-04-21T23:31:18Z")

</div>

> [@fcapozzi](#):
>
> > **libgnuradio-limesdr.so.3.1.2 =\> not found**
> 
> 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.

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.

```auto
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](https://bbs.archlinux.org/viewtopic.php?id=99807)

---

<div class="post-metadata">

**Author:** ![fcapozzi](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@fcapozzi](https://discourse.myriadrf.org/u/fcapozzi)\
**Post date:** [22 April 2020 17:26 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/14 "2020-04-22T17:26:34Z")

</div>

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 !!!

---

<div class="post-metadata">

**Author:** ![vvvelichkov](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/vvvelichkov/32/2844_2.png) [@vvvelichkov](https://discourse.myriadrf.org/u/vvvelichkov)\
**Post date:** [22 April 2020 17:46 UTC](https://discourse.myriadrf.org/t/gnuradio-3-8-and-gr-limesdr-no-module-named-limesdr/5970/15 "2020-04-22T17:46:07Z")

</div>

> [@fcapozzi](#):
>
> In my opinion the cmake configurator should detect the environment of the system and modify its installation path accordingly

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

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

```

From [Filesystem Hierarchy Standard](https://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#USRLOCALLOCALHIERARCHY)

> 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.
