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

cmake error

asked 2020-03-19 20:54:48 -0500

mohamed3020 gravatar image

updated 2020-03-20 05:15:05 -0500

gvdhoorn gravatar image

I have this message will trying the first package please guide me as an absolute beginner THIS IS the output of CMake

mohamed@mohamed:~$ cd ~/catkin_ws
mohamed@mohamed:~/catkin_ws$ catkin_make
Base path: /home/mohamed/catkin_ws
Source space: /home/mohamed/catkin_ws/src
Build space: /home/mohamed/catkin_ws/build
Devel space: /home/mohamed/catkin_ws/devel
Install space: /home/mohamed/catkin_ws/install
#### Running command: "make cmake_check_build_system" in "/home/mohamed/catkin_ws/build"
-- Using CATKIN_DEVEL_PREFIX: /home/mohamed/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.5.2", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/mohamed/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found PythonInterp: /usr/bin/python3 (found version "3.5.2") 
-- Using Python nosetests: /usr/bin/nosetests-2.7
ImportError: "from catkin_pkg.package import parse_package" failed: No module named 'catkin_pkg'
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:74 (safe_execute_process)
  /opt/ros/kinetic/share/catkin/cmake/all.cmake:168 (_catkin_package_xml)
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:56 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/mohamed/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/mohamed/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:528: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-03-19 23:18:22 -0500

roshea6 gravatar image

To me it looks like it could be two things. Either ROS is trying to use Python 3 instead of 2 or you never installed the catkin_pkg python pkg.

First I would try running the following command: pip install catkin_pkg

After that's installed try making your workspace again.

If that doesn't fix it then the problem may be a bit more complex.

edit flag offensive delete link more



First I would try running the following command: pip install catkin_pkg

please do not suggest people to use pip to install Python dependencies. Or at least, not without mentioning all the disadvantages, and the fact that it should not be necessary on platforms for which there are binary packages available (such as Debian and Ubuntu).

On Debian/Ubuntu, sudo apt install python3-catkin-pkg should work.

Either ROS is trying to use Python 3 instead of 2

from the error output, it looks like this is the case.

gvdhoorn gravatar image gvdhoorn  ( 2020-03-20 05:18:52 -0500 )edit

Ah sorry about that I didn't know. Is that just for ROS specific python packages or is that best practice for installing all python packages?

roshea6 gravatar image roshea6  ( 2020-03-20 16:16:08 -0500 )edit

I did that but didn't solved

mohamed3020 gravatar image mohamed3020  ( 2020-03-20 19:02:22 -0500 )edit

It seems like ROS is trying to use python 3 instead of 2 then. First I would make sure that you have python 2 installed on your system. If it is then try making your workspace with following addition: -DPYTHON_EXECUTABLE=/usr/bin/python2

or just do python instead of python2.

roshea6 gravatar image roshea6  ( 2020-03-20 22:50:50 -0500 )edit

Question Tools

1 follower


Asked: 2020-03-19 20:54:48 -0500

Seen: 980 times

Last updated: Mar 20 '20