ros使用catkin_make编译报错Could NOT find PY_em (missing: PY_EM)

-- 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 -DPYTHON_EXECUTABLE=/usr/bin/python3

原因分析

在ubuntu系统中,存在两个python;python2.7和python3.8(注意这两个版本不可删除,否则OS系统瘫痪);又装了一个anaconda后,出现了第三个版本的python3.9.

因此系统中三个版本python:

python2.7
python3.8
anaconda/lib/bin/python3.9

他们的环境别名是:(/usr/bin中见到的软连接)

python2、python3,python

最近的ROS-noetic中,需要用python3,但无法用anaconda内的python3,因此,这里需要选python3.8,别名是python3

参考:https://blog.csdn.net/weixin_48345177/article/details/130136718

你可能感兴趣的:(ROS,ros)