Setting default python paths for the new update.

Hey All,

I would like to make RStudio my defaul IDE, but the only thing holding me back is my need to use python as well as R. Right now, I'm having trouble as I need to transfer over my PYTHONPATH from spyder into R. How do I set up a python path manager in RStudio?

Cheers,

Travis

Hi @TravisB
I not sure to understand well your trouble. You want to use Python with R and Rstudio?

If so the package Reticulate will help :

You can set you Python's path setting the var env RETICULATE_PYTHON.

Hope it help

I did that in order to load python 3 (instead of the default python 2 my comp was using) but now I want to import a module from my file system.
Something like:

from FILE import FUNCTION

but I cannot do that unless
a) my working directory is where the FILE is being held (something I cannot do since there are multiple files all over my system
b) change my python path so that it knows so search along those paths for said FILE.

I'm looking to set up the latter.

Maybe reticulate::import_from_path() could help here

importe_module <- import_from_path("your_module", path = "/usr/local/lib/python3.6/dist-packages")

That would work for my R/Python markdown scripts!
but in this case I'm hoping to use python only files /:
There won't be any R involved in these files. I want to take code that I am currently using spyder for and change to running it in RStudio.