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

rviz fails to build because of wrong Python version

asked 2015-07-09 20:21:56 -0500

jdbrody gravatar image

updated 2015-07-09 22:02:02 -0500

Hello, I'm trying to install indigo from source on an amd64 gentoo machine. The build is failing when trying to build rviz:

  ==> Processing catkin package: 'rviz'
    ==> Building with env: '/opt/ros/indigo/env.sh'
    ==> cmake /opt/ros/ros_catkin_ws/src/rviz -DCATKIN_DEVEL_PREFIX=/opt/ros/ros_catkin_ws/devel_isolated/rviz -DCMAKE_INSTALL_PREFIX=/opt/ros/indigo -DCMAKE_BUILD_TYPE=Release -DSETUPTOOLS_ARG_EXTRA= -DSETUPTOOLS_DEB_LAYOUT=OFF -G Unix Makefiles in '/opt/ros/ros_catkin_ws/build_isolated/rviz'
    -- Boost version: 1.55.0
    -- Found the following Boost libraries:
    --   filesystem
    --   program_options
    --   signals
 ==> Processing catkin package: 'rviz'
==> Building with env: '/opt/ros/indigo/env.sh'
==> cmake /opt/ros/ros_catkin_ws/src/rviz -DCATKIN_DEVEL_PREFIX=/opt/ros/ros_catkin_ws/devel_isolated/rviz -DCMAKE_INSTALL_PREFIX=/opt/ros/indigo -DCMAKE_BUILD_TYPE=Release -DSETUPTOOLS_ARG_EXTRA= -DSETUPTOOLS_DEB_LAYOUT=OFF -G Unix Makefiles in '/opt/ros/ros_catkin_ws/build_isolated/rviz'
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   signals
--   system
--   thread
-- Assimp version has unified headers
-- OGRE_PLUGIN_PATH=/usr/lib64/OGRE
-- Using CATKIN_DEVEL_PREFIX: /opt/ros/ros_catkin_ws/devel_isolated/rviz
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python3.4
-- Using default Python package layout
-- Could NOT find PY_em (missing:  PY_EM) 
CMake Error at /opt/ros/indigo/share/catkin/cmake/empy.cmake:29 (message):
  Unable to find either executable 'empy' or Python module 'em'...  try
  installing the package 'python-empy'
Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/all.cmake:147 (include)
  /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:91 (find_package)
    --   system
    --   thread
    -- Assimp version has unified headers
    -- OGRE_PLUGIN_PATH=/usr/lib64/OGRE
    -- Using CATKIN_DEVEL_PREFIX: /opt/ros/ros_catkin_ws/devel_isolated/rviz
    -- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
    -- This workspace overlays: /opt/ros/indigo
    -- Using PYTHON_EXECUTABLE: /usr/bin/python3.4
    -- Using default Python package layout
    -- Could NOT find PY_em (missing:  PY_EM) 
    CMake Error at /opt/ros/indigo/share/catkin/cmake/empy.cmake:29 (message):
      Unable to find either executable 'empy' or Python module 'em'...  try
      installing the package 'python-empy'
    Call Stack (most recent call first):
      /opt/ros/indigo/share/catkin/cmake/all.cmake:147 (include)
      /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:20 (include)
      CMakeLists.txt:91 (find_package)

The issue I think is that I do have python-empy installed, but only for python2.7. My understanding is that this was the version I wanted to use for ROS anyway, and all the previous packages seemed to find it. Is there a way to find out why it's trying to use python3.4 or more importantly to tell it to use 2.7?

For what it's worth 2.7 is the system default:

maya ~ # eselect python list
Available Python interpreters:
  [1]   python2.7 *
  [2]   python3.3
  [3]   python3.4
maya ~ # python
Python 2.7.9 (default, Dec 25 2014, 06:57:13) 
[GCC 4.8.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

Many thanks, Justin

Update: Following William's suggestion, I ran:

./src/catkin/bin/catkin_make_isolated --install --install-space ${ROS_INSTALL_PREFIX}/indigo -DCMAKE_BUILD_TYPE=Release -DSETUPTOOLS_ARG_EXTRA="" -DSETUPTOOLS_DEB_LAYOUT=OFF -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib64/libpython2.7.so -DPYTHON_EXECUTABLE=/usr/bin/python

This ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-07-09 20:41:17 -0500

William gravatar image

This is most likely a bug in the Python CMake infrastructure which doesn't respect Gentoo's eselect tool's choice. You can explicitly pass the write Python executable and stuff directly to catkin and that should workaround the issue, similar to this:

https://gist.github.com/mikepurvis/98...

That is for OS X, but it's the same idea. If you want to report it to Gentoo, then you should be able to reproduce by using cmake --find-package and show that even though eselect has Python2.7 selected, CMake finds Python3.4.

edit flag offensive delete link more

Comments

Thanks so much William! Please excuse the dumb question, but what argument should I pass to cmake --find-package? It chokes without one and none of the thinkgs I tried seemed right!

jdbrody gravatar image jdbrody  ( 2015-07-09 21:07:04 -0500 )edit

I think it's PythonLibs. After that you have to add more args but it prompts you for those.

William gravatar image William  ( 2015-07-09 22:59:10 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-07-09 20:21:56 -0500

Seen: 746 times

Last updated: Jul 09 '15