在ROS编译时出现了一个错误:
ImportError: "from catkin_pkg.topological_order import topological_order" failed: No module named 'catkin_pkg'
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
提示与PYTHONPATH相关,搜索了其他文章https://blog.youkuaiyun.com/donghao51/article/details/88146532发现需要在添加Python2.7相关的环境变量,说明catkin依赖2.7版本的Python。
export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages
回想之前自己使用过update-alternative工具对Python进行过切换,所以自己的处理方式是再使用update-alternative工具切换或Python2.7,而不是添加环境变量,如下:
$ sudo update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).
Selection Path Priority Status
------------------