ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

No module named tkinter

asked 2020-06-02 20:48:08 -0500

klastine gravatar image

updated 2020-06-03 18:40:05 -0500

I am trying to use tkinter in my ROS environment but I am having some trouble getting it set up. I added it to my 'packages.xml' file like this

<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<depend>python-tk</depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>

but when I install the package with 'rosdep install [my package]', the node I have 'import tkinter' in still will not run, and instead returns 'ImportError: No module named tkinter'. I am relatively new to ROS and have not installed third party packages before so I'm not sure if I'm missing something. Thanks in advance for any help!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-06-04 23:39:20 -0500

klastine gravatar image

Nevermind, I figured it out. I had to use 'import Tkinter' instead of 'import tkinter'.

edit flag offensive delete link more
-1

answered 2022-03-21 11:04:40 -0500

aceirus gravatar image

I managed to resolve this by copying over all the tkinter folders from my working anaconda enviroment files to the ROS python directories like libs and site_packages. One particular one was the futures folder which has another tkinter folder 2 levels down.

I am using ROS Noetic on windows 11. Hope this helps others.

edit flag offensive delete link more

Comments

Copying installed artifacts is very fragile and is not recommended.

tfoote gravatar image tfoote  ( 2022-03-21 12:18:01 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-06-02 20:48:08 -0500

Seen: 744 times

Last updated: Jun 04 '20