Post

2 followers Follow
1
Avatar

Can I use anaconda python in RStudio?

I am very excited about being able to run python scripts directly from the source editor. However, I use the anaconda bundle for python, and would like to be able to use it from RStudio. I have been able to use the pre-installed version of python 2.7 and python libraries associated with it (e.g. numpy, pandas), but not those associated with anaconda. I am on ubuntu 14.04, and the anaconda bin file is located in my ~/username/anaconda/bin.

When I type in echo $PATH in the shell it lists paths to both instances of python. When I use the new shell feature from RStudio, it only shows the path to the pre-installed python.

It seems like this should be a simple fix, but the solution escapes me. How do I get RStudio to recognize my anaconda version of python?

Thanks in advance

Hank
```

William Murrah

Please sign in to leave a comment.

1 comment

2
Avatar

The answer is to add the following to your .Rprofile

`Sys.setenv(PATH = paste("/home/username/anaconda/bin", Sys.getenv("PATH"), sep=":"))'

replacing username with your username, and assuming this is the path to your anaconda directory.

William Murrah 2 votes