执行catkin_make指令, 报“The program ‘catkin_make‘ is currently not installed. ......“

新建catkinworkspace后, 执行catkin_make指令, 报以下错误:

The program 'catkin_make' is currently not installed. You can install it by typing:
sudo apt install catkin

按照提示执行 sudo apt install catkin, 报以下错误:

sudo apt install catkin
[sudo] password for pv0868: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 catkin : Depends: python-catkin-pkg but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

按照提示安装python-catkin-pkg后, 重复执行上面的指令还是报同样的错误.

网上查找解决方法后,发现并不是没有安装catkin, 只是因为环境变量没有配置好.

解决方法:
因为source命令设置的环境变量只能在当前终端中生效,所以应在创建工作空间的终端执行以下命令:

echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

之后再执行catkin_make, 程序能正常执行:

Base path: /home/pv0868/catkin_vio
Source space: /home/pv0868/catkin_vio/src
Build space: /home/pv0868/catkin_vio/build
Devel space: /home/pv0868/catkin_vio/devel
Install space: /home/pv0868/catkin_vio/install
Creating symlink "/home/pv0868/catkin_vio/src/CMakeLists.txt" pointing to "/opt/ros/kinetic/share/catkin/cmake/toplevel.cmake"
####
#### Running command: "cmake /home/pv0868/catkin_vio/src -DCATKIN_DEVEL_PREFIX=/home/pv0868/catkin_vio/devel -DCMAKE_INSTALL_PREFIX=/home/pv0868/catkin_vio/install -G Unix Makefiles" in "/home/pv0868/catkin_vio/build"
####
-- The C compiler identification is GNU 5.5.0
-- The CXX compiler identification is GNU 5.5.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/pv0868/catkin_vio/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.12", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/pv0868/catkin_vio/build/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.12") 
-- Found Threads: TRUE  
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pv0868/catkin_vio/build
####
#### Running command: "make -j8 -l8" in "/home/pv0868/catkin_vio/build"
####

 

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值