编译ROS时出错

在ubuntu14.04下编译ROS时出现如下错误

-- Using PYTHON_EXECUTABLE: /home/ruud/anaconda/bin/python
-- Using Debian Python package layout
-- Using Python nosetests: /usr/bin/nosetests-2.7
ImportError: "from catkin_pkg.package import parse_package" failed: No module named catkin_pkg.package
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/indigo/share/catkin/cmake/safe_execute_process.cmake:11 (message):

出现这个错误的主要原因是,将anaconda设置成了默认的python环境,解决方法是更改系统的默认python环境为系统自带的python环境.
执行如下步骤即可 sudo gedit ~/.bashrc ,删除或注释anaconda的环境变量,添加下面这句即可.

export PATH="/usr/bin/python:$PATH"

如果还出现上面的错误,删掉ros_ws,然后再新建一个ros_ws,接着进行编译即可(注意:重要文件要拷出来,待会儿再放回去就好了).

你可能感兴趣的:(编译ROS时出错)