0
$\begingroup$

Rosanswers logo

ROS 2 tutorial, Introducing turtlesim and rqt, instructs us to execute the following commands in two cmd windows (I am exercising on Windows 10 platform), ros2 run turtlesim turtlesim_node and ros2 run turtlesim turtle_teleop_key. Both commands fails with the error message:

qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Does this mean that I need to install Qt? If yes, why isn't Qt included in Foxy release, or, as part of install instruction? Could you provide the pointer where I can download free version of Qt? Once I install Qt, what else do I need to do so that the turtlesim will work successfully? Thanks a lot for the help.

My foxy installation was successful. At the end of the installation, both ros2 run demo_nodes_cpp talker and ros2 run demo_nodes_py listener worked. I am just started with the ros2 tutorial. The command set | findstr ROS produced the following:

ROS_DISTRO=foxy
ROS_LOCALHOST_ONLY=0
ROS_PYTHON_VERSION=3
ROS_VERSION=2

Originally posted by Sofia.Mabrey on ROS Answers with karma: 31 on 2020-06-11

Post score: 3


Original comments

Comment by Dawson on 2020-06-13:
I have the same issue I would like help getting this going. I also cant run rqt without getting plugin.xml non found errors

Comment by lzsyvj on 2020-06-18:
I have the exact same issue.

Comment by lzsyvj on 2020-06-18:
Found a fix: In Windows 10 set environment variable QT_QPA_PLATFORM_PLUGIN_PATH and point it to where PyQT5 DLL's were installed to, in my case C:\Python38\Lib\site-packages\PyQt5\Qt\plugins\platforms

Comment by Dawson on 2020-06-18:
I will try this tomorrow and see if it works for me too, thank you so much for sharing your fix!!

Comment by Dawson on 2020-06-19:
I mentioned your fix to the Microsoft team and it fixed the same issue on eloquent as well! thank you Izsyvj

Comment by Sofia.Mabrey on 2020-06-21:
It works for me too. Many thanks!

Comment by Tortelenny on 2020-06-30:
Same here! Thank you so much!!

Comment by staticoli on 2020-12-21:
This hasn't helped me, Can someone please help? Also I noticed that is says turtlesim is only available for Dashing onward? I'm using Foxy, is this going to hinder my ability to use turtlesim?

Comment by Hshahzad108277 on 2020-12-25:
Same here with staticoli, this fix doesnt work for me and seems to be the only fix on the internet. If anyone has a new fix please share it

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I run into the same problem. In my case (Foxy on Windows 10), the solution was to set the variable QT_QPA_PLATFORM_PLUGIN_PATH to C:\dev\ros2_foxy\bin\platforms, the path to qwindows.dll delivered by ROS2. It was confusing since there is another qwindows.dll file under C:\Python38\Lib\site-packages\PyQt5\Qt\plugins\platforms as described by @Izsyvj.


Originally posted by flargo with karma: 106 on 2020-12-28

This answer was ACCEPTED on the original site

Post score: 9


Original comments

Comment by prabin_rath on 2021-01-01:
This worked like a charm. Thank You :) I also set that up in the Power Shell profile settings such that I don't have to do it every time I open a new shell.

Comment by sabin on 2021-02-01:
Worked for me as well. Wish the ROS team would add this in their tutorial.

Comment by Erfan Zekri on 2021-03-22:
I tried it and it works for me too. Thank you! It's really necessary to add this solution in ROS2 tutorial

Comment by Dorthyn on 2021-04-13:
It also worked for me!(rolling version on Windows 10). Just like what you said, it is weird that a qwindows.dll is also in PyQt5\Qt\plugins\platforms😑

Comment by 0zzy0sbourne on 2022-02-13:
I don't have \PyQt5 folder inside the \Lib\site-packages. Should i install PyQt5 with pip?

Comment by ROS2_user on 2022-05-26:
This also worked for me!

$\endgroup$

Your Answer

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