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

catkin_make broken after intalling python 3.5 with anaconda的更多相关文章

  1. 【Machine Learning】Python开发工具:Anaconda+Sublime

    Python开发工具:Anaconda+Sublime 作者:白宁超 2016年12月23日21:24:51 摘要:随着机器学习和深度学习的热潮,各种图书层出不穷.然而多数是基础理论知识介绍,缺乏实现 ...

  2. Python,Pycharm,Anaconda等的关系与安装过程~为初学者跳过各种坑

    1.致欢迎词 我将详讲讲述在学Python初期的各种手忙脚乱的问题的解决,通过这些步骤的操作,让你的注意力集中在Python的语法上以及后面利用Python所解决的项目问题上.而我自己作为小白,很不幸 ...

  3. Windows下Python 3.6 + VS2017 + Anaconda 解决Unable to find vcvarsall.bat问题

    Python 3.6 + VS2017 + Anaconda 解决Unable to find vcvarsall.bat问题 已经安装了VS2017,需要将项目中的C代码翻译为Python代码,在编 ...

  4. 001-mac搭建Python开发环境、Anaconda、zsh兼容

    一.概述 mac下搭建python环境推荐使用Anaconda+Pycharm. 1.1.Anaconda Anaconda是一个免费开源的Python和R语言的发行版本,用于计算科学(数据科学.机器 ...

  5. 学习python你必须弄懂的 Python、Pycharm、Anaconda 三者之间的关系

    Python作为深度学习和人工智能学习的热门语言,学习一门语言,除了学会其简单的语法之外还需要对其进行运行和实现,才能实现和发挥其功能和作用.下面来介绍运行Python代码常用到的工具总结. 一.Py ...

  6. python和数据科学(Anaconda)

    Python拥有着极其丰富且稳定的数据科学工具环境.遗憾的是,对不了解的人来说这个环境犹如丛林一般(cue snake joke).在这篇文章中,我会一步一步指导你怎么进入这个PyData丛林. 你可 ...

  7. Python科学计算利器——Anaconda

    (搬运自我在SegmentFault的博客) 最近在用Python做中文自然语言处理.使用的IDE是PyCharm.PyCharm确实是Python开发之首选,但用于科学计算方面,还略有欠缺.为此我尝 ...

  8. Python - 安装并配置Anaconda环境

    1- 简介 官网:https://www.anaconda.com/ Anaconda是一个用于科学计算的Python发行版,适用于数据分析的Python工具,也可以用在大数据和人工智能领域. 支持 ...

  9. 【Python】安装配置Anaconda

    优点:解决Python 库依赖问题 清华安装镜像 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

随机推荐

  1. Sublime Text使用教程【转】

    本文转载自:http://lucida.me/blog/sublime-text-complete-guide/ 摘要(Abstract) 本文系统全面的介绍了 Sublime Text,旨在成为最优 ...

  2. hadoop之Spark强有力竞争者Flink,Spark与Flink:对比与分析

    hadoop之Spark强有力竞争者Flink,Spark与Flink:对比与分析 Spark是一种快速.通用的计算集群系统,Spark提出的最主要抽象概念是弹性分布式数据集(RDD),它是一个元素集 ...

  3. cronolog日志切割

    1. 下载安装 cronolog,它的主页 http://cronolog.org . 下载的是源码,安装过程就是 ./configure, make, make install,最后一步可直接把 s ...

  4. Linux内核抢占与中断返回【转】

    转自:http://blog.csdn.net/tommy_wxie/article/details/7425728 版权声明:本文为博主原创文章,未经博主允许不得转载. [html] view pl ...

  5. arm驱动linux异步通知与异步IO【转】

    转自:http://blog.csdn.net/chinazhangzhong123/article/details/51638793 <[ arm驱动] linux异步通知与 异步IO> ...

  6. weblogic的jar包冲突

    异常: Error creating bean with name 'sessionFactoryWrite' defined in class path resource [applicationC ...

  7. Linux CentOS 6.5 yum安装MongoDB的操作

    安装MongoDB的方法有很多种,可以源代码安装,在CentOS也可以用yum源安装的方法.由于MongoDB更新得比较快,我比较喜欢用yum源安装的方法.64位CentOS下的安装步骤如下: 1.准 ...

  8. 《QT Creator快速入门》

    ui中的类,这样使用无法通过调试: Ui::Dialog ui(&w); w.show(); 而需要改成: Ui::Dialog ui; ui.setupUi(&w); w.show( ...

  9. java 数组基本操作(一维)

    1.数组的声明: 数组类型  数组名[] 2.数组的表示方法 想使用数组中的值,可以使用索引来实现,数组是从0开始的,使用时格式为:数组名[i],比如 a[1],代表第二个值 在数组中要使用数组的长度 ...

  10. 【转】用 SVN Importer 实现 CSVNT 到 SVN 的转换

    转载地址:http://www.blogjava.net/yongbing/archive/2007/03/04/101761.html 用 SVN Importer 实现 CSVNT 到 SVN 的 ...