Ubuntu20.04, ROS Noetic-catkin_make编译报错

1报错如下

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)
...

问题分析

在ubuntu系统中,存在两个python;python2.7和python3.8;又装了一个anaconda后,出现了第三个版本的python3.9,所以需要改为指定采用下面的命令

catkin make -DPYTHON_EXECUTABLE=/usr/bin/python3

2编辑.cpp文件非正常退出后,重新打开时显示错误信息:

1、进入该.cpp文件的存储位置,在此位置打开终端

2、查看:ll

例如输出:

drwxrwxr-x 2 ch ch  4096 12月  7 16:44 ./
drwxrwxr-x 5 ch ch  4096 12月  7 13:58 ../
-rwxr-xr-x 1 ch ch  4751 12月  7 16:23 ground_points_filter.cpp*
-rw-r--r-- 1 ch ch 12288 12月  1 10:12 .ground_points_filter.cpp.swp

3、删除.swp临时交换文件:

rm -rf .ground_points_filter.cpp.swp

即可正常打开该.cpp文件

你可能感兴趣的:(ubuntu)