shinyapps.io with Python - R via Reticulate vs Conda

This general problem of how to use Python in R via Reticulate seems to persist. In the online resources, there are no clear, robust examples of how to deploy Shiny applications that include Python modules to shinyapps.io using reconnect in RStudio.

This speaks to a more general design issue in terms of the espoused benefits of this platform to make code and analyses reproducible and interactive. It's not something I can recommend for others to deploy their applications.

I don't know the details of conda vs. virtual environments in reticulate, but it seems that conda is a better solution for managing packages and virtual environments using reticulate, and it's unclear why conda isn't supported in the deployment for shinyapps.io as a base package. I'm guessing that there is some deeper compatibility issue with conda or maybe a security issue. But, if that's the case, and using virtual environments is the preferred approach for deploying python code using reticulate and shinyapps, then it would be really helpful for someone to post a solid example of how to do this. What exists at present is pretty sparse and not very robust.

4 Likes

I am facing same issues. I integrated PyTrends python package during development of my R-Shiny app and everything is working fine. I am installing in Shinyapps.IO using rsconnect::deployApp and was under the impression that it will take care of python package also. This is not happening. During run of my application from ShinyApp.IOI it can't find python module. Can anyone please help? All my work and enthusiasm to use Python in R fading away.

1 Like

I believe I have found a guide you could try

1 Like

Thanks. I will follow the instructions. Going through the topic it seems python needs to be pre-installed on our machine during development. What I have see is that within R while installing Python package miniconda gets installed. Should this installation of mini conda take care of python on local machine?

1 Like

Any news on here? It's an important issue that is still not clearly documented.

1 Like