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