catkin_make broken after intalling python 3.5 with anaconda
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 pythonThe 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 bothpython2.7
andpython3.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的更多相关文章
- 【Machine Learning】Python开发工具:Anaconda+Sublime
Python开发工具:Anaconda+Sublime 作者:白宁超 2016年12月23日21:24:51 摘要:随着机器学习和深度学习的热潮,各种图书层出不穷.然而多数是基础理论知识介绍,缺乏实现 ...
- Python,Pycharm,Anaconda等的关系与安装过程~为初学者跳过各种坑
1.致欢迎词 我将详讲讲述在学Python初期的各种手忙脚乱的问题的解决,通过这些步骤的操作,让你的注意力集中在Python的语法上以及后面利用Python所解决的项目问题上.而我自己作为小白,很不幸 ...
- Windows下Python 3.6 + VS2017 + Anaconda 解决Unable to find vcvarsall.bat问题
Python 3.6 + VS2017 + Anaconda 解决Unable to find vcvarsall.bat问题 已经安装了VS2017,需要将项目中的C代码翻译为Python代码,在编 ...
- 001-mac搭建Python开发环境、Anaconda、zsh兼容
一.概述 mac下搭建python环境推荐使用Anaconda+Pycharm. 1.1.Anaconda Anaconda是一个免费开源的Python和R语言的发行版本,用于计算科学(数据科学.机器 ...
- 学习python你必须弄懂的 Python、Pycharm、Anaconda 三者之间的关系
Python作为深度学习和人工智能学习的热门语言,学习一门语言,除了学会其简单的语法之外还需要对其进行运行和实现,才能实现和发挥其功能和作用.下面来介绍运行Python代码常用到的工具总结. 一.Py ...
- python和数据科学(Anaconda)
Python拥有着极其丰富且稳定的数据科学工具环境.遗憾的是,对不了解的人来说这个环境犹如丛林一般(cue snake joke).在这篇文章中,我会一步一步指导你怎么进入这个PyData丛林. 你可 ...
- Python科学计算利器——Anaconda
(搬运自我在SegmentFault的博客) 最近在用Python做中文自然语言处理.使用的IDE是PyCharm.PyCharm确实是Python开发之首选,但用于科学计算方面,还略有欠缺.为此我尝 ...
- Python - 安装并配置Anaconda环境
1- 简介 官网:https://www.anaconda.com/ Anaconda是一个用于科学计算的Python发行版,适用于数据分析的Python工具,也可以用在大数据和人工智能领域. 支持 ...
- 【Python】安装配置Anaconda
优点:解决Python 库依赖问题 清华安装镜像 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
随机推荐
- 从Windows 8 安装光盘安装.NET Framework 3.5.1
在安装一些应用时, 例如安装 Oracle, 可能会缺少了安装 .Net FrameWork 3.5.1 无法继续. 最简单的方法当时是,直接进 控制面板, 在添加删除程序内, 选择增加Windows ...
- Linux kernel的 Makefile和Kconfig以及Make menuconfig的关系【转】
本文转载自:http://blog.sina.com.cn/s/blog_4ba5b45e0102e6vp.html 熟悉内核的Makefile对开发设备驱动.理解内核代码结构都是非常重要的linux ...
- zabbix监控mysql主从
最近在公司搭建了zabbix监控系统,现在需要用zabbix来监控mysql的主从同步情况 现在说一下配置的详细步骤: 1.首先给mysql分配一个监控的账号: mysql> grant rep ...
- Linux驱动中completion接口浅析(wait_for_complete例子,很好)【转】
转自:http://blog.csdn.net/batoom/article/details/6298267 completion是一种轻量级的机制,它允许一个线程告诉另一个线程工作已经完成.可以利用 ...
- Mysql String Functions
SUBSTRING_INDEX(str,delim,count) 按标识符截取指定长度的字符串 mysql); -> 'www.mysql' mysql); -> 'mysql.com' ...
- linux中Iptables限制同一IP连接数防CC/DDOS攻击方法
1.限制与80端口连接的IP最大连接数为10,可自定义修改. 代码如下 复制代码 iptables -I INPUT -p tcp --dport 80 -m connlimit --connlim ...
- mongo VUE 操作
一 修改字段名称 db.rc_配置_付款限额_消费.update({ "生效标识" : 1, "$atomic" : "true" },{ ...
- ACM题目————A除以B
本题要求计算A/B,其中A是不超过1000位的正整数,B是1位正整数.你需要输出商数Q和余数R,使得A = B * Q + R成立. 输入格式: 输入在1行中依次给出A和B,中间以1空格分隔. 输出格 ...
- Improving the GPA 分类: 贪心 HDU 比赛 2015-08-08 16:12 11人阅读 评论(0) 收藏
Improving the GPA Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) ...
- Scrapy学习教程
http://scrapy-chs.readthedocs.io/zh_CN/0.24/intro/tutorial.html 在线学习教程: http://learnpythonthehardway ...