# 执行 roslaunch 提示 Command not found

> 原文链接：https://robotics.hellobike.com/pitfalls/2022-11-17-robotics-se-20445
> 频道：pitfalls | 更新日期：2022-11-17 | 标签：auto, stackexchange, ros, ros-melodic, roslaunch
> 核心摘要：roslaunch 找不到时先检查 ROS 环境变量、可执行文件和权限，必要时重装 ROS 元包。

# 执行 roslaunch 提示 Command not found

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[roslaunch not found](https://robotics.stackexchange.com/questions/20445/roslaunch-not-found)（Robotics Stack Exchange #20445）

**状态**：已解决

## 问题

运行 `roslaunch arm robot_spawn.launch` 报 `Command 'roslaunch' not found`，系统建议安装 `python-roslaunch`；提问者此前可启动，添加节点后出现问题。

## 环境

Ubuntu 18.04；ROS melodic；`.bashrc` 中已有 `source /opt/ros/kinetic/setup.bash`。

## 解决办法

1. 执行 `echo $PATH`，确认 ROS 的 `bin` 目录在路径首项；答案示例为 `/opt/ros/kinetic/bin`。
2. 执行 `sudo find / -name roslaunch`，确认存在 `/opt/ros/kinetic/bin/roslaunch` 等文件。
3. 执行 `ls -l /opt/ros/kinetic/bin/roslaunch`，检查输出中是否有 `x` 可执行权限。
4. 若仍找不到或无法定位原因，可执行 `sudo apt purge ros-kinetic-desktop-full`、`sudo apt autoremove`、`sudo apt install ros-kinetic-desktop-full`；答案还建议必要时重装系统。

原问题作者：heretoinfinity；采纳答案作者：xperroni。原内容依 CC BY-SA 4.0 授权，本页摘要同样依 CC BY-SA 4.0 授权。
:::

## 原始参考来源 (Sources)

- [Robotics Stack Exchange #20445：roslaunch not found](https://robotics.stackexchange.com/questions/20445/roslaunch-not-found)