Can't seem to build using catkin_make in ros:noetic and Python 3.8

asked 2021-06-08 18:44:40 -0500

hugols16 gravatar image

Given a docker container based off of osrf/ros:noetic-desktop-full on Ubuntu focal (20.04), every time I run caktin_make in the workspace directory, it throws the following error:

/usr/bin/python3: can't open file '/usr/bin/empy': [Errno 2] No such file or directory CMake Error at /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message): execute_process(/root/catkin_ws/build/catkin_generated/env_cached.sh "/usr/bin/python3" "/usr/bin/empy" "--raw-errors" "-F" "/root/catkin_ws/build/catkin_generated/order_packages.py" "-o" "/root/catkin_ws/build/catkin_generated/order_packages.cmake" "/opt/ros/noetic/share/catkin/cmake/em/order_packages.cmake.em") returned error code 2

Seems that /usr/bin/empy does not exist, and when trying to install it (via pip) it gets installed under /usr/lib/python3/dist-packages and thus can't be found. Adding the latter link to the python path doesn't seem to help either.

Running the exact same Dockerfile but replacing noetic with melodic works and I can now see /usr/bin/empy. What am I missing to get this package or change the way the packages are built?

edit retag flag offensive close merge delete

Comments

I encountered the same issue resolved by:
remove everything within ~/catkin_ws $ mkdir ~/catkin_ws/src $ cd ~/catkin_ws $ catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3 Once you've tried to run catkin_make without the python3 flag, further attempts will use the previously generated files and keep failing. It seems to be as simple as removing the directory contents and trying again with the correct python, however.

RoboCthulu gravatar image RoboCthulu  ( 2021-08-30 11:41:07 -0500 )edit