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. android 项目学习随笔七(ViewPagerIndicator与ViewPager)

    1.ViewPagerIndicator https://github.com/JakeWharton/ViewPagerIndicator package com.viewpagerindicato ...

  2. vsftp不同帐号的目录和权限

    搭建FTP服务器,供虚拟用户使用,实现不同用户具有不同家目录和权限. 1.用户peter的家目录为/var/ftp/vuserdir/peter,他只有下载权限,没有其他权限(创建目录.重命名.删除. ...

  3. [转]centos中wget的使用方法

    本文转自 http://www.cnblogs.com/chusiping/archive/2011/11/10/2243805.html 和 http://www.jb51.net/os/RedHa ...

  4. Dynamics AX 2012 R2 外部程序运行在没有AD的环境(如PDA) 调用AX服务

        Reinhard对这个问题研究了很久,也查了一些资料,整理了三种解决方案. 1.准备一台虚拟机A,A加入到了AD活动域,可以操作AX. PDA以远程桌面的方式,连接到虚拟机A. 在虚拟机上运行 ...

  5. Can't create/write to file '/tmp/#sql_887d_0.MYD' (Errcode: 17)

    lsof |grep "#sql_887d_0.MYD" 如果没有被占用就可以删掉 . https://wordpress.org/support/topic/cant-creat ...

  6. 关于Quartus II 13.0对应开发NIOS II软件程序时报错Symbol 'NULL' could not be resolved问题的解决方法

    关于Quartus II 13.0对应开发NIOS II软件程序时报错Symbol 'NULL' could not be resolved问题的解决方法 近期在评估使用NIOS II处理器进行项目的 ...

  7. HttpClient I/O exception (java.net.SocketException) caught when processing request: Connect

    转自:http://luan.iteye.com/blog/1820054 I/O exception (java.net.SocketException) caught when processin ...

  8. PHP无限级分类-递归(不推荐)

    [http://www.helloweba.com/view-blog-204.html] 在一些复杂的系统中,要求对信息栏目进行无限级的分类,以增强系统的灵活性.那么PHP是如何实现无限级分类的呢? ...

  9. [算法]判断一个数是不是2的N次方

    如果一个数是2^n,说明这个二进制里面只有一个1.除了1. a  = (10000)b a-1 = (01111)b a&(a-1) = 0. 如果一个数不是2^n, 说明它的二进制里含有多一 ...

  10. uwsgi安装过程中遇到的问题

    参考这篇文章: [root@crz_oa webserver]# uwsgi --http :9090 --wsgi-file home.py --daemonize /var/log/uwsgi.l ...