gnuradio / gr-inspector

Signal Analysis Toolbox for GNU Radio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not with with GRC 3.7.13.4

papadeltasierra opened this issue · comments

I can run non-GR-Inspector projects but with GR-Inspector I get this on attempting to start.

Loading: "/home/pds/Documents/GNURadio/detect433.grc"
>>> Done

Generating: '/home/pds/Documents/GNURadio/top_block.py'

Executing: /usr/bin/python2 -u /home/pds/Documents/GNURadio/top_block.py

Traceback (most recent call last):
  File "/home/pds/Documents/GNURadio/top_block.py", line 26, in <module>
    from gnuradio import qtgui
  File "/usr/lib/python2.7/dist-packages/gnuradio/qtgui/__init__.py", line 37, in <module>
    from range import Range, RangeWidget
  File "/usr/lib/python2.7/dist-packages/gnuradio/qtgui/range.py", line 67, in <module>
    class RangeWidget(QtWidgets.QWidget):
AttributeError: 'module' object has no attribute 'QWidget'

>>> Done

It seems slightly odd to me that this appears to be a core-GRC error but is GR-Inspector somehow causing a clash between QT4 and QT5 code? Does GR-Inspector need to be tweaked to work with QT5 before it will work with newer GRC?

Weird, I never saw this message. From digging in the code I see that line 67 in range.py differs from what is available online: https://github.com/gnuradio/gnuradio/blob/v3.7.13.4/gr-qtgui/python/qtgui/range.py#L67 where it says QtGui.QWidget instead of QtWidgets.QWidget. Can you explain why this is?

Sounds odd, I'll check my build machine later. In the meantime you might be interested in the pds/qt5 branch on my clone of gr-inspector where I've been trying to get this to build using QT5. It will not be 'pretty' because I'm not very familiar with Ubuntu build stuff of Qt4/5 but it does now build. I won't be doing more with it unless I have too but do copy anything of interest. With luck I'll get something working soon :-).

Went back to check. I suspect there is a GnuRadio/Qt5 bug because range.py imports QtGui and attempts to use QtGui.QWidget. The result is the same error as above but referencing QtGui instead of QtWidgets. QWidgets have moved between QT4 and QT5 so I changed to importing QtWidgets and using QtWidgets.QWidget but still saw the same error, albeit with a different name. Now that I have compiled gr-inspector to try and use Qt5, this error has gone away making me suspect that the range.py was being used via gr-inspector (I didn't see these problems with a non gr-inspector project) and there was a combination of qt4/gr-inspector and qt5/gnuradion issues. I'll follow up with the Gnuradio people about the GtGui/GtWidgets issue.

Update. Managed to get close to running having...

  • Latest bleeding edge Ubuntu
  • The range.py GnuRadio GtGui.GWidget => GtWidgets.GWidget patch
  • My attempts to make GR-Inspector use Qt5
  • A complete rebuild of tensorflow because my laptop is old and the standard package uses opcodes not provided by the T4500 processor.
    Now I'm seeing an error as below:
 File "/home/pds/Documents/GNURadio/top_block.py", line 195, in <module>
    main()
  File "/home/pds/Documents/GNURadio/top_block.py", line 183, in main
    tb = top_block_cls()
  File "/home/pds/Documents/GNURadio/top_block.py", line 124, in __init__
    self.inspector_tfmodel_vcf_0 = inspector.tfmodel_vcf("message",1,'',(),0)
  File "/usr/local/lib/python2.7/dist-packages/inspector/tfmodel_vcf.py", line 55, in __init__
    inputs.append((np.dtype(dtype), vlen))
TypeError: data type "message" not understood

>>> Done (return code 1)

I may come back and look at this but my 'quick 10 minutes project' has already expanded somewhat ;-). And I realise that this is probably quite off-piste so I won't be offended if you close this issue if it provides nothing useful to you.

@papadeltasierra gr-inspector depends on Qt4. I can't make any statements on Qt5 compatibility. Can you point to where the discussion is continued in case someone runs into the same problem?

Hello. I have recently updated to GNU Radio 3.7.13.4-4 on archlinux (manjaro), and it has stopped working altogether with Qt GUI applications, giving a very similar error as posted above:

File "/usr/lib/python2.7/dist-packages/gnuradio/qtgui/range.py", line 67, in
class RangeWidget(QtGui.QWidget):
AttributeError: 'module' object has no attribute 'QWidget'

This error also arises if I type "from gnuradio import qtgui" inside python2.7. Do you know if this discussion has continued elsewhere, as mentioned?

Thanks a lot!

Hey, i have the same problem currently.
I found this thread: https://trac.macports.org/ticket/56993#no1 and am currently trying to downgrade python2-pyqt4 to 4.12.1.
Also on Manjaro

Okay, can confirm, my minimal flowgraph (noise source to QT GUI Time Sink) works with this version.

You basically remove the previously installed packages (in my case pyqt4-common python2-pyqt4), download the PKGBUILD file from AUR (https://aur.archlinux.org/packages/python2-pyqt4/).
You need to change the pkgversion to 4.12.1 (pkgver=4.12.1) and the sha256sums to the appropriate one (sha256sums=('45d724461ae58b019b9be95076ca07e212eb73084aec9125bb254825c3a05383')).

I hope that helps!

Dear Havok-at,

Thanks a lot! I can confirm that with your proposed solution, GNU Radio works with Qt GUI based applications in manjaro. So it was the version of python2-pyqt4, which was also recently upgraded in my system, not the version of GNU Radio...

Best regards!

@HavoK-at I can also confirm the fix works by installing python2-pyqt4@4.12.1.

I wonder what is the long-term solution to this, should Gnuradio adapt to the new pyqt4 release, or should we look at switching to QT5?