0
$\begingroup$

Rosanswers logo

Hello,

I am using ROS melodic on Arch linux. I installed ROS and it's plugins using yay. I am able to use all parts of ROS just like I used to on my ubuntu. The only problem is with rqt_* plugins. I have installed them on my system. Whenever I try to launch them, I am faced with the following error.

Note that I have sourced ROS environment using following command. (I have placed it in my .bashrc.)

source /opt/ros/melodic/setup.bash

For ex. here I am starting rqt_image_view and I get the following error. (The error is the same even if I run it using rosrun rqt_image_view rqt_image_view having run roscore).

[jack@lenovo ~]$ rqt_image_view 
CompositePluginProvider.discover() could not discover plugins from provider "<class 'rqt_gui.rospkg_plugin_provider.RospkgPluginProvider'>":
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python3.9/site-packages/qt_gui/composite_plugin_provider.py", line 57, in discover
    plugin_descriptors = plugin_provider.discover(discovery_data)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 67, in discover
    plugin_descriptors += self._parse_plugin_xml(package_name, plugin_xml)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 128, in _parse_plugin_xml
    for library_el in root.getiterator('library'):
AttributeError: 'ElementTree' object has no attribute 'getiterator'

CompositePluginProvider.discover() could not discover plugins from provider "<class 'qt_gui.recursive_plugin_provider.RecursivePluginProvider'>":
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python3.9/site-packages/qt_gui/composite_plugin_provider.py", line 57, in discover
    plugin_descriptors = plugin_provider.discover(discovery_data)
  File "/opt/ros/melodic/lib/python3.9/site-packages/qt_gui/recursive_plugin_provider.py", line 53, in discover
    plugin_descriptors = self._plugin_provider.discover(discovery_data)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 67, in discover
    plugin_descriptors += self._parse_plugin_xml(package_name, plugin_xml)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 128, in _parse_plugin_xml
    for library_el in root.getiterator('library'):
AttributeError: 'ElementTree' object has no attribute 'getiterator'

CompositePluginProvider.discover() could not discover plugins from provider "<class 'qt_gui.recursive_plugin_provider.RecursivePluginProvider'>":
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python3.9/site-packages/qt_gui/composite_plugin_provider.py", line 57, in discover
    plugin_descriptors = plugin_provider.discover(discovery_data)
  File "/opt/ros/melodic/lib/python3.9/site-packages/qt_gui/recursive_plugin_provider.py", line 53, in discover
    plugin_descriptors = self._plugin_provider.discover(discovery_data)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 67, in discover
    plugin_descriptors += self._parse_plugin_xml(package_name, plugin_xml)
  File "/opt/ros/melodic/lib/python3.9/site-packages/rqt_gui/ros_plugin_provider.py", line 128, in _parse_plugin_xml
    for library_el in root.getiterator('library'):
AttributeError: 'ElementTree' object has no attribute 'getiterator'

qt_gui_main() found no plugin matching "rqt_image_view/ImageView"
try passing the option "--force-discover"

I have been facing this thing for sometime and unable to resolve this problem. Any help would be greatly appreciated.


Originally posted by jacka122 on ROS Answers with karma: 5 on 2021-02-20

Post score: 0


Original comments

Comment by ejalaa12 on 2021-02-20:
You're using ROS melodic, which works python2, but it seems you're using python3. The error you're getting is because rqt in melodic is implemented in python2, and specifically uses the xml standard library. The getiterator method exists only in python2 and was deprecated since python2.7.

Comment by jacka122 on 2021-02-25:
Anyway I could resolve this issue?

Comment by ejalaa12 on 2021-02-25:
Actually the getiterator method was removed between python3.8 and python3.9. What you could do is either use python3.8, that should work, you would only get a deprecation warning. Or you can clone the rqt_gui package in a workspace and edit the ros_plugin_provider.py file to replace getiterator with iter. Compile and source.

Comment by jacka122 on 2021-02-25:
Thanks a ton! compiling works like a charm! Boy I wish there had been some sort of backward compatibility with python. Anyway thanks a lot! I am surprised I could not find the problem reported by others! What are the odds I stubmled onto this!?

Comment by ejalaa12 on 2021-02-25:
You welcome :). The deprecation warning for using this method was available since python 2.7 ! which means they had until python 3.8 to use the new method. The old method was finally removed in python3.9. You were on a very edgy case indeed ^^. Could you tick the answer I posted then ?

Comment by jacka122 on 2021-02-25:
Of course! I ticked the answer :)

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

the getiterator method was removed between python3.8 and python3.9. What you could do is either use python3.8, that should work, you would only get a deprecation warning. Or you can clone the rqt_gui package in a workspace and edit the ros_plugin_provider.py file to replace getiterator with iter. Compile and source.


Originally posted by ejalaa12 with karma: 81 on 2021-02-25

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by gvdhoorn on 2021-02-26:
And .. in all cases report on the appropriate issue tracker and as @jacka122 now knows how to fix it: contribute the fix in a Pull Request.

Comment by gvdhoorn on 2021-02-26:
And it seems someone already reported it: ros-visualization/rqt#240, and there is also a Pull Request fixing it: ros-visualization/rqt#241.

Comment by ejalaa12 on 2021-02-26:
@jacka122 so your issue will be fixed as soon as the PR will be merged. At this point you won't need your local modified version of the package.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.