Ask Your Question

I need help making/building a catkin package.

asked 2013-04-26 12:54:12 -0500

packrat gravatar image

updated 2014-01-28 17:16:21 -0500

ngrennan gravatar image

Let me start off by saying that I have read the tutorials on how to make a package and how to build it, but I seem to be too stupid to get it right because it never works. I am running ros groovy on Ubuntu 12.04lts. This is what I am trying to do, build a package that can be started by a launch file. The package is a python script that reads a serial line form a arduino and publishes it on a ros topic. The package that I want to make is all based around "". After I build the package, I try to run it with

walle@wallebase:~/catkin_ws$ rosrun encoder_feedback
Traceback (most recent call last):
  File "/home/walle/catkin_ws/src/encoder_feedback/scripts/", line 4, in <module>
    import rospy
  File "/opt/ros/groovy/lib/python2.7/dist-packages/rospy/", line 49, in <module>
    from .client import spin, myargv, init_node, \
  File "/opt/ros/groovy/lib/python2.7/dist-packages/rospy/", line 46, in <module>
    import yaml
ImportError: No module named yaml

What do I need to do to build a working package? Let me know if I need to post the .py code or include more info. Thanks for any help you can give.

edit retag flag offensive close merge delete


Do you have a run_depend for python-yaml in your package.xml?

joq gravatar image joq  ( 2013-04-26 15:48:47 -0500 )edit

No I don't. just <build_depend>std_msgs</build_depend><build_depend>rospy</build_depend><run_depend>std_msgs</run_depend><run_depend>rospy</run_depend>

packrat gravatar image packrat  ( 2013-04-27 07:13:42 -0500 )edit

All I am importing is import serial import time import rospy from std_msgs.msg import Int32

packrat gravatar image packrat  ( 2013-04-27 07:25:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-04-26 15:24:34 -0500

Have you seen this question? Try this and comment your results...

edit flag offensive delete link more


walle@wallebase:~$ sudo apt-get install python-yaml Reading package lists... Done Building dependency tree
Reading state information... Done python-yaml is already the newest version. python-yaml set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

packrat gravatar image packrat  ( 2013-04-27 07:14:31 -0500 )edit

check /usr/lib/python2.7/dist-packages and /usr/lib/python2.6/dist-packages for python-yaml

gustavo.velascoh gravatar image gustavo.velascoh  ( 2013-04-27 17:33:45 -0500 )edit

Both pythons have yaml

packrat gravatar image packrat  ( 2013-04-28 06:29:45 -0500 )edit

Any ideas?

packrat gravatar image packrat  ( 2013-05-04 03:50:21 -0500 )edit

Can I download your code for try to run it... Do you have the package in a repo?

gustavo.velascoh gravatar image gustavo.velascoh  ( 2013-05-04 05:09:11 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-04-26 12:54:12 -0500

Seen: 240 times

Last updated: Apr 26 '13