Robotics StackExchange | Archived questions

how to resolve ModuleNotFoundError: No module named 'catkin_pkg'

Hi All,

I am new to ROS and could some one please share some inputs with me to resolve this issue.

  1. I am seeing "ModuleNotFoundError: No module named 'catkinpkg'" error when I have recreated the my own package. Does it mean that we should run "ros2 pkg create –build-type amentpython –node-name my_node " twice in the same workspace?

  2. I am trying to run "colcon build" in a new workspace and I am seeing below error. please provide some tips on how to resolve this issue.

Starting >>> rviz2 --- stderr: rviz2 Traceback (most recent call last):
File "/home/niranjan/ros2foxy/install/amentcmakecore/share/amentcmakecore/cmake/core/packagexml2cmake.py", line 21, in from catkinpkg.package import parsepackagestring ModuleNotFoundError: No module named 'catkinpkg' CMake Error at /home/niranjan/ros2foxy/install/amentcmakecore/share/amentcmakecore/cmake/core/amentpackagexml.cmake:94 (message):
execute
process(/home/niranjan/colconvenv/venv/bin/python3 /home/niranjan/ros2foxy/install/amentcmakecore/share/amentcmakecore/cmake/core/packagexml2cmake.py /home/niranjan/ros2foxy/src/ros2/rviz/rviz2/package.xml /home/niranjan/ros2foxy/build/rviz2/amentcmakecore/package.cmake) returned error code 1 Call Stack (most recent call first):
/home/niranjan/ros2
foxy/install/amentcmakecore/share/amentcmakecore/cmake/core/amentpackagexml.cmake:49 (amentpackagexml)
/home/niranjan/ros2
foxy/install/amentcmakecore/share/amentcmakecore/cmake/core/amentpackage.cmake:63 (amentpackagexml)
CMakeLists.txt:101 (ament
package)

Failed <<< rviz2 [12.7s, exited with code 1]

Aborted <<< ros1_bridge [27min 2s]

Thanks

Asked by rao on 2022-11-15 13:26:53 UTC

Comments

ros2 : If you are using ROS2 then you havee to use colcon build.

Asked by Ranjit Kathiriya on 2022-11-17 10:29:50 UTC

Answers