ros-visualization / rqt_bag

http://wiki.ros.org/rqt_bag
31 stars 55 forks source link

NameError: global name 'qInfo' is not defined #15

Closed mikepurvis closed 7 years ago

mikepurvis commented 7 years ago

Issue appears in Lunar on OS X, see https://github.com/mikepurvis/ros-install-osx/issues/89.

Two instances, both in bag_widget.py: https://github.com/ros-visualization/rqt_bag/search?q=qInfo

yosoufe commented 7 years ago

Hi, I have the following problem in ROS kinetic in Ubuntu 16.04. When I am trying to open the rqt_bag it gives me this error?

Traceback (most recent call last):
  File "/opt/ros/kinetic/bin/rqt_bag", line 5, in <module>
    from rqt_bag.bag import Bag
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_bag/bag.py", line 39, in <module>
    from .bag_widget import BagWidget
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_bag/bag_widget.py", line 40, in <module>
    from python_qt_binding.QtCore import Qt, qInfo, qWarning, Signal
ImportError: cannot import name qInfo

Ros is updated today with apt upgrade. How can I solve the issue?? How can I get any version number that can be useful for debugging?

Shall I make a new issue??

mikepurvis commented 7 years ago

Per this page, qInfo was introduced in QT 5.5, and Xenial has 5.5.1:

https://packages.ubuntu.com/source/xenial/qtbase-opensource-src

I wonder if this is possibly a gap in Xenial's version of pyqt5? Noting that QtCore comes in via that:

https://github.com/ros-visualization/python_qt_binding/search?q=QtCore


Yeah, confirm that all these symbols are from inside the pyqt5 shared object, yuck:

$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
>>> import python_qt_binding.QtCore
>>> print python_qt_binding.QtCore.__file__
/usr/lib/python2.7/dist-packages/PyQt5/QtCore.x86_64-linux-gnu.so

In any case, I can reproduce this trivially on my Xenial VM:

$ python -c "from python_qt_binding.QtCore import qInfo"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name qInfo

My bad for submitting an OS X patch that wasn't tested on the support platforms, though I wouldn't have imagined this would be an issue. :(

@dirk-thomas Could either switch these back to qWarns, or put a polyfill in our python_qt_binding package to supply the missing function as required.

dirk-thomas commented 7 years ago

Could either switch these back to qWarns, or put a polyfill in our python_qt_binding package to supply the missing function as required.

qWarning implies printing to stderr which doesn't seem appropriate. I would propose to switch the calls to qDebug instead. See #17.

I don't see what python_qt_binding should map the call to?

mikepurvis commented 7 years ago

Yeah, that's not really an answer. Good call to just switch it to debug.

dirk-thomas commented 7 years ago

@yosoufe rqt_bag version 0.4.11 will fix the problem. I have just released that version so it might be a bit until it is available from Debian packages. Sorry for the inconvenience.

yosoufe commented 7 years ago

Thanks @dirk-thomas How can I check my rqt_bag version? Because I still have the problem. I also checked with my colleagues and they have the same problem. Do you know how long it may take until the debian repo get updated?

dirk-thomas commented 6 years ago

How can I check my rqt_bag version?

dpkg -l | grep rqt-bag

Do you know how long it may take until the debian repo get updated?

The "release manager" for each ROS distro makes the decision when to sync the latest packages from the testing repo to the stable repo. You can follow the conversation on discourse for updates on the progress.