Problem

"No module named catkin_pkg.package" on catkin_make w/ Indigo

I have the problem after anaconda is installed. I get an error because of the different PYTHONPATH used by anaconda.

Solution 1: turn off anaconda

In the end of file ~/.bashrc, you will find export PATH="/home/YOURUSRNAME/anaconda3/bin:$PATH" .

In fact the ROS should use python in /opt/ros/indigo/lib/python2.7/dist-packages. Uncomment it and source ~/.bashrc then it works.

Solution 2:

http://answers.ros.org/question/220546/catkin_make-failure-due-to-python-anaconda/

Without turning off anaconda, just run pip install catkin_pkg, it may be helpful.

Conclusion

Basically the problem happens because ROS is confused with python location due to different path of python used by anaconda.

Here are some reference that instructs us how to navigation the specified python.

When the system cannot position python

installed python 3.5 thenI get this error: -bash: /usr/bin/python: No such file or directory

http://stackoverflow.com/questions/15236832/how-do-i-reinstall-a-directory-in-usr-bin-python

 sudo rm /usr/bin/python # because that's a corrupted file  
sudo ln -s /usr/bin/python2.7 /usr/bin/python

When you need to change the default version of python

https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux

Change python version system-wide

To change python version system-wide we can use update-alternatives command. Logged in as a root user, first list all available python alternatives:

# update-alternatives --list python
update-alternatives: error: no alternatives for python

The above error message means that no python alternatives has been recognized by update-alternatives command. For this reason we need to update our alternatives table and include both python2.7 and python3.4:

# update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode
# update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2
update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python (python) in auto mode

When you cannot do catkin_make with the error "No module named rospkg"

http://answers.ros.org/question/39657/importerror-no-module-named-rospkg/

The reason this error occurs is because Python packages in /opt are added to PYTHONPATH environment variable BUT for ones in /usr, path does not exist in PYTHONPATH variable. The python-rospkg gets installed in /usr by default. So you just need followingline in .bashrc to fix this:

export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages

最新文章

  1. ThinPHP基础
  2. jQuery Mobile的基本使用
  3. C语言的关键字,运算符,标识符
  4. CSS 命名管理 之 BEM
  5. jQueryUI Datepicker的使用
  6. C编程风格的人机交互 -- CSHELL (提供源码下载)
  7. Es使用。
  8. BestCoder Round #2 1001 (简单处理)
  9. -_-#【Markdown】
  10. 通过ComponentName获取相应的Widget
  11. javascript基础学习(十一)
  12. 海量数据面试题----分而治之/hash映射 + hash统计 + 堆/快速/归并排序
  13. 疯狂Android第二章:Adapter以及部分控件使用
  14. Xamarin自定义布局系列——PivotPage,多页面切换控件
  15. C#委托冒泡
  16. Boolean 类型转换
  17. lua时间戳和日期转换及踩坑
  18. mysql并行执行--缩短主从同步时延
  19. 【linux】进程状态
  20. ios 内存管理与property copy strong weak assign

热门文章

  1. 【secureCRT】如何在secureCRT上设置常用的快捷输出按钮栏
  2. 从追MM谈Java的23种设计模式(转)
  3. laravel5.1启动详解
  4. run loop 输入源
  5. canvas 动画
  6. postgresql压力测试工具用法以及参数解读
  7. Struts输出流向jsp页面写入图片乱码
  8. String类方法
  9. java 同步锁方法
  10. oracle 主键自增