ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

PYTHONPATH is not set correctly by source devel/setup.bash

asked 2016-01-04 09:42:13 -0600

martin1412 gravatar image

I am having some issues with the PYTHONPATH that is set by my ROS environment.

my .bashrc contains the following lines:

source /opt/ros/jade/setup.bash
source /home/x/workspace/devel/setup.bash

If I print my PYTHONPATH in a new bash it looks like this:


The PYTHONPATH contains only workspace-specific packages.

This results in failure, when trying to import the catkin package from a python interpreter (as it is for example required when importing a rosnode project in qtcreator)

I investigated this problem a little bit, and it seems as if the first sourcing command sets the


(which is where the catkin package is found) The second sourcing command however resets the path, and only appends the workspace specific part again.

Is this the intended behavior?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-01-21 07:00:13 -0600

martin1412 gravatar image

I don't really know what the problem was, I removed the whole workspace and set it up again. It seems to work now

edit flag offensive delete link more

answered 2016-01-21 05:26:29 -0600

gvdhoorn gravatar image

Is this the intended behavior?

Most likely, yes. I see this:

source /opt/ros/jade/setup.bash
source /home/x/workspace/devel/setup.bash

more and more on ROS Answers, and I'm not sure why. The second source .. line will cause that setup.bash to overwrite environment variables set by the first one.

Can you clarify why you have your .bashrc setup like that?

edit flag offensive delete link more

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: 2016-01-04 09:42:13 -0600

Seen: 4,282 times

Last updated: Jan 21 '16