首页 > 代码库 > catkin_make broken after intalling python 3.5 with anaconda
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