0

I have a shiny app that requires python code. Source_python works fine when I call it from RStudio, but when I run the shiny app (sourcing the python file from within app.R), the python code is not available.

I am using a virtual python environment with all dependencies installed. I called py_config() from RStudio as well as from within the shiny app, and the output was identical.

Any idea why this is still not working?

1 Answer 1

1

I moved the source_python call into an R script, and sourced that R script in app.R.

app.R:
library(shiny)
library(reticulate)
source("FUNS.R")

FUNS.R:
reticulate::source_python("ABC.py")

Now the app runs fine on RStudio Server and also when deployed to a remote Shiny Server.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.