catkin init/build 遇到catkin:command not found 的解决办法。

本文介绍了在安装ROS环境中遇到catkin_init或catkin_build命令未找到的问题及其解决方法。通常,这表明catkin_tools包尚未正确安装。文章提供了详细的步骤来安装所需的catkin_tools包。

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

背景:

安装ROS环境点击打开链接后,catkin_make可以跑,但是如果跑catkin init或者catkin build就会遇到catkin:command not found。


原因:

发文的此时,包含catkin init/build 的catkin_tool 包还没发布。单纯的安装ROS,是不会安装这个包的。我们需要手动装。


解决办法:

先试试:

$ sudo apt-get update

$ sudo apt-get install python-catkin-tools

(我这样就OK了)


如果不行试试:

$ sudo sh -c 'echo "deb http://package.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'

$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -

$ sudo apt-get update

$ sudo apt-get install python-catkin-tools

(参考的是 点击打开链接


(carla) 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 Creating symlink "/home/dwh/carla-ros-bridge/catkin_ws/src/CMakeLists.txt" pointing to "/opt/ros/noetic/share/catkin/cmake/toplevel.cmake" #### #### 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" #### -- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- 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 -- Found PythonInterp: /home/dwh/ProgramFiles/anaconda3/envs/carla/bin/python3 (found suitable version "3.7.12", minimum required is "3") -- 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
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值