catkin_make broken after intalling python 3.5 with anaconda

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了catkin_make broken after intalling python 3.5 with anaconda相关的知识,希望对你有一定的参考价值。

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

I have the problem after anaconda is installed.

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.

 

Reference:

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

  sudo ln -s /usr/bin/python2.7 /usr/bin/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

以上是关于catkin_make broken after intalling python 3.5 with anaconda的主要内容,如果未能解决你的问题,请参考以下文章

Catkin_make 不更新我保存的 python 文件

catkin_make 中的 cmake 版本与全局 cmake 版本不同?

catkin_make 浅析

运行 catkin_make 时调用“make -j4 -l4”失败错误

执行 catkin_make 时出错:调用“make -j1 -l1”失败

catkin_make 无法创建可执行文件并自动复制头文件到devel