Skip to content

Integrating RStudio Workbench with Python#

These instructions describe how to install and integrate Python and reticulate with RStudio Workbench, formerly RStudio Server Pro1.

Once you configure Python and reticulate with RStudio Workbench, users will be able to develop mixed R and Python content with Shiny apps, R Markdown reports, and Plumber APIs that call out to Python code using the reticulate package.

Step 1. Install Python for all users#

  • Install Python on the server with RStudio Workbench in a central location for all users (e.g., /opt/python/3.7.7/).

    Info

    Our recommended installation instructions for Python allow you to make multiple versions of Python available and avoid replacing existing versions of Python when updating system packages.

Step 2. Install reticulate for all users#

  • Install the reticulate R package for all users in the global R library.
    For example, if R is installed in /opt/R/3.7.7/, then you you can use the following command:

    Terminal
    $ sudo /opt/R/3.7.7/bin/Rscript -e 'install.packages("reticulate")'
    

Step 3. Configure reticulate with Python for all users#

  • Set the RETICULATE_PYTHON environment variable for all RStudio Workbench users by putting the following line in the R session-specific profile script used by RStudio Workbench.
    For example, if Python is installed in /opt/python/3.7.7/, then you you can use the following configuration:

    File: /etc/rstudio/rsession-profile
    export RETICULATE_PYTHON=/opt/python/3.7.7/bin/python
    

Additional Information#

For more information on end-users working with custom, per-project Python environments, refer to the support article on Installing and Configuring Python with RStudio.


  1. We have renamed RStudio Server Pro to RStudio Workbench. This change reflects the product’s growing support for a wide range of different development environments. RStudio Workbench enables R and Python data scientists to use their preferred IDE in a secure, scalable, and collaborative environment -- whether that is the RStudio IDE, JupyterLab, Jupyter Notebooks, or VS Code. We want RStudio Workbench to be the best single platform to support open source, code-first data science, whether your team is using R or Python. Please see our official Announcement and review our FAQ regarding the name change from RStudio Server Pro to RStudio Workbench.