Search code examples
pythonubuntuwindows-subsystem-for-linuxgnuradiognuradio-companion

GNU Radio WSL Ubuntu 20.04 ImportError: libQt5Core


All,

After installing the Windows 10 Subsystem for Linux (WSL) and Ubuntu 20.04, I created a flowgraph that relied on QT.

The example I followed to install WSL and GNU is: https://wiki.analog.com/resources/tools-software/linux-software/gnuradio

My Python version is 3.8.2 and my GRC version is 3.8.1.0

From the same terminal that I installed everthing, I finally launched GRC gnuradio-companion

I built a flow graph and was greeted by an error when running it. The error I receiver after building the flow graph is:

Traceback (most recent call last):
  File "/home/jameshayek/GNURadio-Projects/FMReceiver.py", line 38, in <module>
    from gnuradio.qtgui import Range, RangeWidget
  File "/usr/lib/python3/dist-packages/gnuradio/qtgui/__init__.py", line 36, in <module>
    from .qtgui_swig import *
  File "/usr/lib/python3/dist-packages/gnuradio/qtgui/qtgui_swig.py", line 13, in <module>
    from . import _qtgui_swig
ImportError: libQt5Core.so.5: cannot open shared object file: No such file or directory

I'd like to note,during the install, I did include sudo apt-get install qt5-default

After going back to the terminal, I tried to find libQt5Core find /usr -name libQt5Core but nothing returned. I am unsure why...

I included gnuradio-dev as well as build-essential

I also set my PYTHONPATH by finding it first using:

find /usr -name gnuradio | grep "packages"

Which returned /usr/lib/python3/dist-packages/gnuradio

I then set the PYTHONPATH:

export PYTHONPATH=$PYTHONPATH:/usr/lib/python3/dist-packages/gnuradio

In the same terminal I was able to echo $PYTHONPATH to see:

:/usr/lib/python3/dist-packages/gnuradio

In a new terminal, the same command would yield nothing to return, so I modified the ~./bashrc file to include the path stated above. All new terminals now spew out /usr/lib/python3/dist-packages/gnuradio

Thinking this was an issue with the PATH I assumed the problem would have been resolved. So, after closing out GRC and all Ubuntu terminals, I relaunched a new terminal to call GRC.

Same error. Nothing I did helped.

Any advice?


Solution

  • Looks like WSL's issue #3023. Make sure you've libqt5core5a package installed on your system and then try applying the strip workaround as described in the issue.

    sudo apt-get install libqt5core5a
    sudo strip --remove-section=.note.ABI-tag /lib/x86_64-linux-gnu/libQt5Core.so.5
    

    After going back to the terminal, I tried to find libQt5Core find /usr -name libQt5Core but nothing returned.

    In order to find the file you need to either use a regex or specify the full filename.

    $ find /usr -name "libQt5Core.so*"
    /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
    
    $ find /usr -name libQt5Core.so.5
    /usr/lib/x86_64-linux-gnu/libQt5Core.so.5