ROS catkin error:PY_EM is missing

文章讲述了在Ubuntu20.04环境下使用ROSNoetic时,遇到catkin_make报错关于PY_em的问题。解决方案是将CATKIN_MAKE变量中的PYTHON_EXECUTABLE指向系统的Python3解释器,而非Anaconda环境中的。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Ubuntu20.04, ROS Noetic,根据ROS tutorial,

ROS/Tutorials - ROS Wiki

$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/
$ catkin_make
报错如下,

matthew@UBUT:~/catkin_ws$ catkin_make
...
-- Using PYTHON_EXECUTABLE: /home/matthew/anaconda3/envs/torch/bin/python3
-- Using Debian Python package layout
-- Could NOT find PY_em (missing: PY_EM) 
CMake Error at /opt/ros/noetic/share/catkin/cmake/empy.cmake:30 (message):
  Unable to find either executable 'empy' or Python module 'em'...  try
  installing the package 'python3-empy'
Call Stack (most recent call first):
  /opt/ros/noetic/share/catkin/cmake/all.cmake:164 (include)
  /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:58 (find_package)
...
 
根据下面的链接,

catkin_make errors with cmake regarding PY_em/PY_EM/empy/em · Issue #2 · ros-melodic-arch/ros-melodic-catkin · GitHub

这是因为catkin找的的python版本为anaconda下面的版本,所以需要改为指定采用下面的命令

catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3
结果就一切正常了。


原文链接:https://blog.youkuaiyun.com/tanmx219/article/details/122765853

dwh@PC:~/carla-ros-bridge/catkin_ws$ catkin_make clean Base path: /home/dwh/carla-ros-bridge/catkin_ws Source space: /home/dwh/carla-ros-bridge/catkin_ws/src Build space: /home/dwh/carla-ros-bridge/catkin_ws/build Devel space: /home/dwh/carla-ros-bridge/catkin_ws/devel Install space: /home/dwh/carla-ros-bridge/catkin_ws/install #### #### Running command: "cmake /home/dwh/carla-ros-bridge/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/dwh/carla-ros-bridge/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/dwh/carla-ros-bridge/catkin_ws/install -G Unix Makefiles" in "/home/dwh/carla-ros-bridge/catkin_ws/build" #### -- Using CATKIN_DEVEL_PREFIX: /home/dwh/carla-ros-bridge/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/noetic -- This workspace overlays: /opt/ros/noetic -- Using PYTHON_EXECUTABLE: /home/dwh/ProgramFiles/anaconda3/envs/carla/bin/python3 -- Using Debian Python package layout -- Could NOT find PY_em (missing: PY_EM) CMake Error at /opt/ros/noetic/share/catkin/cmake/empy.cmake:30 (message): Unable to find either executable 'empy' or Python module 'em'... try installing the package 'python3-empy' Call Stack (most recent call first): /opt/ros/noetic/share/catkin/cmake/all.cmake:164 (include) /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:20 (include) CMakeLists.txt:58 (find_package) -- Configuring incomplete, errors occurred! See also "/home/dwh/carla-ros-bridge/catkin_ws/build/CMakeFiles/CMakeOutput.log". Invoking "cmake" failed dwh@PC:~/carla-ros-bridge/catkin_ws$ catkin_make Base path: /home/dwh/carla-ros-bridge/catkin_ws Source space: /home/dwh/carla-ros-bridge/catkin_ws/src Build space: /home/dwh/carla-ros-bridge/catkin_ws/build Devel space: /home/dwh/carla-ros-bridge/catkin_ws/devel Install space: /home/dwh/carla-ros-bridge/catkin_ws/install #### #### Running command: "cmake /home/dwh/carla-ros-bridge/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/dwh/carla-ros-bridge/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/dwh/carla-ros-bridge/catkin_ws/install -G Unix Makefiles" in "/home/dwh/carla-ros-bridge/catkin_ws/build" #### -- Using CATKIN_DEVEL_PREFIX: /home/dwh/carla-ros-bridge/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/noetic -- This workspace overlays: /opt/ros/noetic -- Using PYTHON_EXECUTABLE: /home/dwh/ProgramFiles/anaconda3/envs/carla/bin/python3 -- Using Debian Python package layout -- Could NOT find PY_em (missing: PY_EM) CMake Error at /opt/ros/noetic/share/catkin/cmake/empy.cmake:30 (message): Unable to find either executable 'empy' or Python module 'em'... try installing the package 'python3-empy' Call Stack (most recent call first): /opt/ros/noetic/share/catkin/cmake/all.cmake:164 (include) /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:20 (include) CMakeLists.txt:58 (find_package) -- Configuring incomplete, errors occurred! See also "/home/dwh/carla-ros-bridge/catkin_ws/build/CMakeFiles/CMakeOutput.log". Invoking "cmake" failed
03-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值