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

gentoo: genmsg error at catkin compile

asked 2014-10-09 22:07:59 -0600

kenneth gravatar image

updated 2014-10-10 20:48:22 -0600

Currently, I'm following this tutorial to install ROS indigo.

At compile I get the following complaint and I'm not really sure what to do or where to go from here.

Traceback (most recent call last):
  File "/opt/ros/ros_catkin_ws/build_isolated/genmsg/catkin_generated/", line 19, in <module>
    from catkin.environment_cache import generate_environment_script

ImportError: No module named catkin.environment_cache

CMake Error at /opt/ros/indigo/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  returned error code 1

Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/all.cmake:185 (safe_execute_process)
  /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:3 (find_package)

-- Configuring incomplete, errors occurred!
See also "/opt/ros/ros_catkin_ws/build_isolated/genmsg/CMakeFiles/CMakeOutput.log".
<== Failed to process package 'genmsg': 
  Command '/opt/ros/indigo/ cmake /opt/ros/ros_catkin_ws/src/genmsg -DCATKIN_DEVEL_PREFIX=/opt/ros/ros_catkin_ws/devel_isolated/genmsg -DCMAKE_INSTALL_PREFIX=/opt/ros/indigo -DCMAKE_BUILD_TYPE=Release -DSETUPTOOLS_ARG_EXTRA= -DSETUPTOOLS_DEB_LAYOUT=OFF' returned non-zero exit status 1

Reproduce this error by running:
==> cd /opt/ros/ros_catkin_ws/build_isolated/genmsg && /opt/ros/indigo/ cmake /opt/ros/ros_catkin_ws/src/genmsg -DCATKIN_DEVEL_PREFIX=/opt/ros/ros_catkin_ws/devel_isolated/genmsg -DCMAKE_INSTALL_PREFIX=/opt/ros/indigo -DCMAKE_BUILD_TYPE=Release -DSETUPTOOLS_ARG_EXTRA= -DSETUPTOOLS_DEB_LAYOUT=OFF

UPDATE: Yes, the 15th step. I tried opening another terminal but end up just compiling less than before, I'm not sure if this will give you any clues but i'm not even really sure what the 14th step does, just thought it was telling ROS where to find python.

UPDATE 2: I tried following the ROS official source guide as well and end up on the same step now. The big reason I couldn't compile before was due to dependencies which have since been resolved (I think). Which leaves me at square one, why is python not importing catkin.environment?

edit retag flag offensive close merge delete


Setting PYTHONPATH tells python where it should look for additional modules to import. Since ROS isn't installing python modules into the system directories, the PYTHONPATH needs to be set.

ahendrix gravatar image ahendrix  ( 2014-10-10 20:51:16 -0600 )edit

For debugging, I would start by searching the filesystem for environment_cache* and cross-check that with your PYTHONPATH.

ahendrix gravatar image ahendrix  ( 2014-10-10 20:52:43 -0600 )edit

Were you able to resolve this?

(also, I doubt this is a gentoo specific problem)

2ROS0 gravatar image 2ROS0  ( 2015-12-18 14:13:26 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-10 01:25:49 -0600

ahendrix gravatar image

I'm guessing here, but I suspect you're on step 15 from those instructions.

It can't find the catkin ptyhon library, so my first guess would be that your PYTHONPATH isn't set properly.

I would check that your PYTHONPATH isn't set, and then you can try sourcing your bashrc or starting a new shell and confirming that it's set properly. (Step 14 should set up your PYTHONPATH for new shells, but won't affect existing shells).

If that works, you should probably contact the tutorial's author and ask them to update it and/or repost it on the ROS wiki.

edit flag offensive delete link more



The tutorial also instructs readers to use sudo everywhere, and sets up a catkin workspace in /opt/. I'm not sure whether that is such a good idea.

gvdhoorn gravatar image gvdhoorn  ( 2014-10-10 03:53:55 -0600 )edit

Question Tools


Asked: 2014-10-09 22:07:59 -0600

Seen: 2,340 times

Last updated: Oct 10 '14