Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set RETICULATE_PYTHON to support better use of Python from RStudio #1

Open
yuvipanda opened this issue Oct 6, 2023 · 1 comment
Open

Comments

@yuvipanda
Copy link

Currently, trying to use Reticulate to access python from RStudio is a bit of a mess. See this thread on the openscapes slack (https://openscapes.slack.com/archives/C02NC3Y62J1/p1696449495538389) for examples.

Setting RETICULATE_PYTHON env var to (the fully expanded version of) ${CONDA_PREFIX}/bin/python will actually solve almost all these issues for users of this image. There are upstream fixes that @cboettig has graciously offered to bring up with reticulate, but we don't have to wait on those getting fixed.

We should:

  1. Set this as an ENV directive so it is picked up by jupyter and terminals in jupyter
  2. Put this inside ${R_HOME}/etc/Renviron.site so it's picked up by RStudio (which doesn't pick up env vars the regular way). The existing file should be apended to, not clobbered. I think on this image R_HOME is /usr/local/lib/R. It won't have CONDA_PREFIX set so the fully expanded path should be set.
@eeholmes
Copy link

To be explicit, add this to the Dockerfile

echo "PATH=${PATH}" >>"${R_HOME}/etc/Renviron.site"

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

No branches or pull requests

2 participants