rviz fails to build because of wrong Python version
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 ...