The best approach for using Python with RStudio Server Pro (RSP) is to install Python from source for the same reasons we recommend this approach for R versions. This way, you can manage multiple versions of Python and decouple it from the system versions of Python.
The difference between using Python with RSP vs. RStudio Connect (RSC) is that for RSP, each user can create a virtual environment with Python to perform development work, whereas RSC will use the service account (default rstudio-connect) to automatically create virtual environments in Python for each application that is deployed.
This means that the process for installing Python with RSC (for app publishing) looks like:
Each user will create a virtualenv using a command like: /opt/Python/3.6.8/bin/virtualenv ~/python
User can install packages in their virtualenv using ~/python/bin/pip install pandas matplotlib and so on
Each user will configure the RETICULATE_PYTHON environment variable to point to the Python executable in their virtualenv, I recommend using either ~/.Rprofile or ~/.Renviron to set this
Thanks for bringing up this question, as we are working on additional articles and assets around using Python with RSP and RSC, which we will summarize on https://solutions.rstudio.com/ when that information is ready.
In the mean time, we have some of this information documented here:
Thanks a lot ! That is a great overview and perfect guidelines.
I would like to find a way to not explain to every user that they have to configure themselves their python setup, but I may offer them specific install function like usethis to help setting things up with reticulate.
On the R side, having on site-library already configured globally help greatly reduce the "admin-like-stuff" for the majority of the user. I would like the experience with python the same: one global configuration that works for everyone, and the choice for advanced user to go further and setup their session more precisely.
I follow the https://solutions.rstudio.com/ website. having a RSS feed or a way to know that there is new article would really help. There is such feature on support.rstudio.com with article, and it is very useful being able to register for email notification.
Don't know what is possible with your template.
Yes, you can definitely optimize the steps that I outlined via usethis and installing more site-wide packages. You can consider the steps that I outlined a minimal/basic starting point. And we'll continue to optimize those steps based on user feedback like yours!