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

I am getting cmake failed error when executing catkin_make command for Ros packages

asked 2020-03-28 06:51:59 -0500

hitesh khanna gravatar image

updated 2020-03-28 13:53:11 -0500

I am using Ubuntu on a virutal box to run ROS melodic. I have made some package to build custom message. when i try to catkin_make i get the cmake failed error.

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/melodic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  execute_process(/usr/bin/python3
  "/opt/ros/melodic/share/catkin/cmake/parse_package_xml.py"
  "/opt/ros/melodic/share/catkin/cmake/../package.xml"
  "/home/hitesh/catkin_ws/build/catkin/catkin_generated/version/package.cmake")
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/melodic/share/catkin/cmake/catkin_package_xml.cmake:74 (safe_execute_process)
  /opt/ros/melodic/share/catkin/cmake/all.cmake:168 (_catkin_package_xml)
  /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:56 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/hitesh/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/hitesh/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:320: 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

Comments

I have attached the screenshot as well

there is no screenshot attached.

This is a good thing, as error messages are text. Text should not be shown in a screenshot, but just copied into your question, verbatim.

Please copy-paste the error message into your question, select the lines of the error and press ctrl+k or click the Preformatted Text button (the one with 101010 on it).

gvdhoorn gravatar image gvdhoorn  ( 2020-03-28 11:50:23 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2020-03-28 20:40:57 -0500

updated 2020-03-28 20:56:42 -0500

It looks like Catkin detects Python 3 as the default interpreter. ROS Python packages are installed for the default version of Python which is Python 2 on Ubuntu Bionic (since you tagged melodic). Please see #q337135 and #q340510. The answers are clear and comprehensive.

In short, you will either need to make Catkin use the Python 2 interpreter (recommended) or install catkin_pkg for the Python 3 interpreter.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-03-28 06:51:59 -0500

Seen: 1,100 times

Last updated: Mar 28 '20