我是 ubuntu 的新手,我正在尝试添加
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
然后我重新加载了.bashrc
source ~/.bashrc
现在我被这个困住了 - 每次我启动终端时,我都会首先得到这个:截图 #1
bash: /catkin_ws/devel/setup.bash: No such file or directory
bash: /home/ros/Home/catkin_ws/devel/setup.bash: No such file or directory
编辑:在cat ~/.bashrc
我得到以下(文件的最后几行)之后:
else
if [ -f "/home/ros/anaconda3/etc/profile.d/conda.sh" ]; then
."/home/ros/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/home/ros/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
source /opt/ros/noetic/setup.bash
source /catkin_ws/devel/setup.bash
source ~/catkin_ws/devel/setup.bash
source ~/catkin_ws/devel/setup.bash
source ~/catkin_ws/devel/setup.bash
source ~/Home/catkin_ws/devel/setup.bash
source ~/catkin_ws/devel/setup.bash
source ~/catkin_ws/devel/setup.bash
source ~/catkin_ws/devel/setup.bash
并ls ~/catkin_ws/devel
给出:
cmake.lock local_setup.bash setup.bash setup.zsh
env.sh local_setup.sh setup.sh share
lib local_setup.zsh _setup_util.py
好的,看看你的结尾,你
.bashrc
能看出问题吗?看起来您多次尝试执行该命令
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
,其中一些包含错误。您需要做的是编辑您的
~/.bashrc
文件,例如使用 nano:现在,删除最后不需要的所有行(在 之后
# <<< conda initialize <<<
)。我假设您还需要该文件/opt/ros/noetic/setup.bash
,因此请保留以下几行: