Ask Your Question

Erro Invoking "cmake" failed

asked 2020-06-05 03:59:23 -0500

hiago gravatar image

updated 2020-06-05 04:35:56 -0500

Good morning, I'm having a problem when configuring cmake to use the ros Kinetic, I'm following this tutorial, but when running $ catkin_make, I have the problem below:

Base path: /home/hiago/catkin_ws
Source space: /home/hiago/catkin_ws/src
Build space: /home/hiago/catkin_ws/build
Devel space: /home/hiago/catkin_ws/devel
Install space: /home/hiago/catkin_ws/install

#### Running command: "cmake /home/hiago/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/hiago/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/hiago/catkin_ws/install -G Unix Makefiles" in "/home/hiago/catkin_ws/build"

-- Using CATKIN_DEVEL_PREFIX: /home/hiago/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/hiago/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

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:60 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/hiago/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/hiago/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

I'm not sure about the problem, but I believe it has something to do with the python version since Ros uses one version and CMake another. I've tried everything, I can't find anything else on the web to help me, help me please!

edit retag flag offensive close merge delete


Desculpem está mal formatado, minha primeira vez postando uma pergunta

that's not really a problem, we can fix that for you.

What is a problem is that you posted in a language other than English.

This is an English-only forum, so please post your questions in English.

I'll close this for now, but I will re-open after you've translated everything into English.

You don't need to post a new question: just click the edit button/link.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-05 04:11:51 -0500 )edit

I've already edited it, I'm so desperate that I didn't pay attention, sorry.

hiago gravatar image hiago  ( 2020-06-05 04:30:27 -0500 )edit

No problem. I've re-opened it.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-05 04:33:23 -0500 )edit

You write:

I'm having a problem when configuring cmake to use the ros Kinetic and install ABB

could you link to what exactly you are trying to install? We don't know what "install ABB" means.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-05 04:33:58 -0500 )edit

I am trying to configure CMake, this information about "installing ABB" was just information that I thought would be useful, but I will remove them because they are not relevant to the problem.

hiago gravatar image hiago  ( 2020-06-05 04:35:41 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-06-05 05:03:13 -0500

gvdhoorn gravatar image

This would appear to be the classic problem where you're attempting to use a Python interpreter which doesn't have the ROS Python packages installed.

Note this part of the Catkin/CMake output:

-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.5.2", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Found PythonInterp: /usr/bin/python3 (found version "3.5.2")

ROS Kinetic officially only supports Python 2.x, which means that the official ROS Kinetic Python packages will only be installed for the system default Python interpreter on your OS.

Assuming you are running Ubuntu Xenial, this would be Python 2.7.12.

Assuming you have installed ROS Kinetic using apt, the ROS Python packages would have been installed for that version of Python.

I'm not sure why CMake decides to use Python 3.x on your system, but that is the problem, as this Python interpreter will not be able to find the catkin_pkg package, leading to the error you show.

There is a Python 3 version of catkin_pkg, but if you have no absolute necessity to use Python 3.x with your Kinetic installation, I would probably recommend overriding the version of Python for CMake and set it to 2.x instead.

edit flag offensive delete link more


It worked, it took me a while to uninstall, but it resolved, I was using 2 different tutorials, one using the version of python2 that ros uses and the other python3. I followed the own ros and it worked, thanks! :D

hiago gravatar image hiago  ( 2020-06-05 15:29:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-06-05 03:19:25 -0500

Seen: 31 times

Last updated: Jun 05