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

rqt ImportError: No module named my_module (different from previous post)

asked 2015-07-17 03:22:33 -0500

Panos gravatar image

Hello, In my attempt to create an rqt gui in ROS indigo, following the tutorials http://wiki.ros.org/rqt/Tutorials/Cre... and http://wiki.ros.org/rqt/Tutorials/Wri... , with the use of a .ui file, I began with just a simple version (two QPushButtons and a QLabel), just to check if it works. Unfortunately, it doesn't, while it gives me this error:

RosPluginProvider.load(rqt_mypkg/MyPlugin) exception raised in __builtin__.__import__(rqt_mypkg.my_module, [MyPlugin]):
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rqt_gui/ros_plugin_provider.py", line 77, in load
    module = __builtin__.__import__(attributes['module_name'], fromlist=[attributes['class_from_class_type']], level=0)
ImportError: No module named my_module

I have checked for other similar questions, like http://answers.ros.org/question/18882... and http://answers.ros.org/question/20540... (I also had the same mistakes, which I corrected), but still, the same error occurs. I have put my code (and the related files) here: https://github.com/PanosP/rqt-mypkg-fail .

My environment variables are:

ROS_ROOT=/opt/ros/indigo/share/ros
ROS_PACKAGE_PATH=/home/panosss/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://localhost:11311
ROS_TEST_RESULTS_DIR=/home/panosss/catkin_ws/build/test_results
ROSLISP_PACKAGE_DIRECTORIES=/home/panosss/catkin_ws/devel/share/common-lisp
ROS_DISTRO=indigo
ROS_ETC_DIR=/opt/ros/indigo/etc/ros
PYTHONPATH=/home/panosss/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/indigo/lib/python2.7/dist-packages:/home/panosss/naoqi/pynaoqi-python2.7-2.1.3.3-linux64

and I work on Ubuntu 14.04.2 LTS. Does anybody have any idea what could have gone wrong?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-07-18 12:19:34 -0500

130s gravatar image

You have _init_.py. It has to be __init__.py , double-underscore, not single. See http://stackoverflow.com/questions/44...

edit flag offensive delete link more

Comments

Thank you very very much! (It now gives me some other errors but I will fix them and post when it is ready)

Panos gravatar image Panos  ( 2015-07-19 02:57:30 -0500 )edit

Just to close it, the "other errors" had to do with the loadUi function, but it is irrelevant with this question (I did it without using ui)

Panos gravatar image Panos  ( 2015-08-13 17:11:52 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-07-17 03:22:33 -0500

Seen: 930 times

Last updated: Jul 19 '15