Skip to content
This repository was archived by the owner on Dec 6, 2021. It is now read-only.

Conversation

jgoppert
Copy link

@jgoppert jgoppert commented Jun 1, 2017

I use ROS and anaconda regularly on the same system. I included the script that I use and an example of usage.

@Shreeyak
Copy link

Shreeyak commented Jan 11, 2018

This is a very good way of dealing with the ROS+Anaconda conflict. When I'd suggested unset $PYTHONPATH, I did not properly test the setup. Unsetting PYTHONPATH causes a lot of problems in ROS and should not be used.

There is a modification that should be made though. Conda should not be appended to the $PATH, that also causes problems at times in ROS. Instead, we can use symlinks to the full paths. Here's what I did:
Create a folder called .conda-symlinks in home directory. Create 3 symlinks to the activate, conda and deactivate scripts (these reside in the <root conda directory>/bin).

shrek@shrek-pc-ubuntu:~/.conda-symlink$ ls -l
total 0
lrwxrwxrwx 1 shrek shrek 34 Sep 23 01:31 activate -> /home/shrek/anaconda3/bin/activate
lrwxrwxrwx 1 shrek shrek 31 Sep 23 01:30 conda -> /home/shrek/anaconda3/bin/conda
lrwxrwxrwx 1 shrek shrek 36 Sep 23 01:31 deactivate -> /home/shrek/anaconda3/bin/deactivate

Now, we can add this folder to $PATH in .bashrc:

#Sourcing ROS
source /opt/ros/kinetic/setup.bash

#Sourcing conda
export PATH=/home/shrek/.conda-symlink:$PATH

See this article: https://dev.to/bgalvao/conda--dealing-with-conflicting-pythons-in-your-system-62n

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants