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

roslib - Phyton

asked 2012-08-06 03:19:54 -0600

Janina gravatar image

updated 2012-08-06 03:20:57 -0600

Hello!

I create a Phyton project within the ar_pose package. I tried to import roslib to my Phyton program with

import roslib; roslib.load_manifest('ar_pose')

,but get the answer that he could not found the module roslib.

Is roslib a own package which I have to download?

Thanks!

(ROS electric)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-08-06 03:34:34 -0600

Lorenz gravatar image

Your PYTHON_PATH needs to be set up correctly. Did you source setup.bash?

edit flag offensive delete link more
0

answered 2012-08-11 00:04:18 -0600

raymachira gravatar image

I have the same exact problem. I sourced setup.bash and my PYTHON_PATH is set to ${ROS_ROOT}/core/roslib/src:${PYTHONPATH}

Basically here is my whole setup.sh file

export ROS_ROOT=/opt/ros/electric/ros
export PATH=${ROS_ROOT}/bin:${PATH}
export PYTHONPATH=${ROS_ROOT}/core/roslib/src:${PYTHONPATH}
export ROS_PACKAGE_PATH=/opt/ros/electric/stacks
if [ ! "$ROS_MASTER_URI" ] ; then export ROS_MASTER_URI=http://localhost:11311 ; fi

I am trying to run a python file through a package I have made. Any help is appreciated. I'm sorry of my formatting is out of order- I am new to the forum.

edit flag offensive delete link more

Comments

It would be better to create a new question for that. Answers should only be used for really answering a question but not for discussion. When you create a new question, please also copy-paste the python backtrace you are getting.

Lorenz gravatar image Lorenz  ( 2012-08-11 05:01:26 -0600 )edit

Btw. don't create your own setup.sh but either source /opt/ros/electric/setup.bash and extend ROS_PACKAGE_PATH if needed or use rosws. rosws is the recommended way though. See here: http://ros.org/wiki/fuerte/Installation/Overlays

Lorenz gravatar image Lorenz  ( 2012-08-11 05:02:56 -0600 )edit

Am really sorry for that. I have posted a new question, here --> http://answers.ros.org/question/41241/importerror-no-module-named-roslib/

raymachira gravatar image raymachira  ( 2012-08-13 00:40:57 -0600 )edit

Question Tools

Stats

Asked: 2012-08-06 03:19:54 -0600

Seen: 683 times

Last updated: Aug 11 '12