Trouble using Python Packages with Reticulate and

I am trying to publish a Shiny app which uses Reticulate and other Python packages. However I don't know how to install Python packages on the server.

When I load the package pandas or twitter and deploy the app with shinyapps, I get the following error.

Error in value[[3L]](cond) : ImportError: No module named pandas
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

Here is my code.


test_var = py$my_var

server <- function(input, output) { 
  output$test_text <- renderText(py$my_var)

ui <- fluidPage(textOutput('test_text'))

shinyApp(ui, server)

If you run the app, you can see that I'm able to pass values from the python script to R on, but I'm unable to import packages.

How can I use Python packages with shinyapps?

I believe that you need to call py_install(c('pandas', 'twitter')) in order for those modules to be installed and importable.


Thanks Josh, that worked!

1 Like

A post was split to a new topic: with Python - R via Reticulate vs Conda