Skip to content

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

Description

@yuvipanda

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions