Having trouble using Anaconda with ROS?

Not me. At least, not anymore.

As anyone who has ever tried to install Anaconda alongside ROS (Robot Operating System) knows, those two don’t get along very well.
If Anaconda is added to the PATH, ROS tools can behave very unexpectedly – most often they will just fail.

To fix this, one can add another user so that ROS and Conda keep their distance.
However, switching user just to use different programs isn’t convenient.
This is why I published this little script on GitHub.
All you have to do is change the path of the Anaconda installation in the variable at the top of the script and source it from your .bashrc.
(If you added Anaconda to the PATH during installation, remove the line that adds the path to the Anaconda binary folder to your PATH)
Now, all Anaconda commands will get aliased and when using one, Anaconda will be added to the PATH, the command is executed and as soon as it terminated, Anaconda is removed from the PATH again.

The script was tested using Ubuntu 16.04 with ROS Kinetic and Anaconda 4.4.
It should work on all bash systems, though.

Leave a Reply