Search code examples
ros

catkin_make , when i try to create in ubuntu 18 it shows 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/akash/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:58 (find_package)


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

This was the error i am getting and i am very new to ros. i dont know even how to describe this error.


Solution

  • i figured out the answer . What i understood is the catkin_make should able to access python3. So i tried to install catkin_pkg using

    pip install catkin_pkg.
    

    But i got a error of

    pip not found but can be installed with sudo
    

    So then i installed python 3 pip using

     sudo apt install python3-pip
    

    Then i has access to install pip in terminal.so i installed catkin_pkg using

    pip3 install catkin_pkg
    

    So then when i try to run catkin_make it runs successfully.

    But i couldnot figured how this all worked magically can someone explain me