Robotics StackExchange | Archived questions

catkin_make error: No module named 'catkin_pkg'

Hi I can not resolve error with catkin_make procedure Could you please give some hint , the error is as follow :

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/michal/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/michal/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/michal/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:320: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1

Asked by Michal73 on 2020-11-23 06:03:38 UTC

Comments

Answers

It appears you are using ROS Melodic (built against Python2) but the build process is trying to use Python3 similar to this answer. This may occur because of an improper environment setup. Did you source the correct setup files (e.g., source /opt/ros/melodic/setup.bash)?

Asked by tryan on 2020-11-23 10:22:34 UTC

Comments

Thank you for replay !!! , I will confirm and let you know

Asked by Michal73 on 2020-11-24 03:07:47 UTC