Using h2o package in shinyapps.io RShiny application

Hi I am unable to use the H2O package when deploying my RShiny on shinyapps.io. It works when I run the app locally, but when I run try to deploy it I get this error:

ERROR: tensorflow 2.4.1 has requirement h5py~=2.10.0, but you'll have h5py 3.2.1 which is incompatible.
Installing collected packages: six, google-pasta, numpy, opt-einsum, termcolor, wheel, astunparse, gast, markdown, idna, urllib3, certifi, requests, absl-py, grpcio, tensorboard-plugin-wit, werkzeug, pyasn1, rsa, cachetools, pyasn1-modules, google-auth, oauthlib, requests-oauthlib, google-auth-oauthlib, protobuf, tensorboard, flatbuffers, wrapt, tensorflow-estimator, h5py, keras-preprocessing, typing-extensions, tensorflow, pyyaml, scipy, keras, Pillow
  Attempting uninstall: six
    Found existing installation: six 1.14.0
    Not uninstalling six at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'six'. No files were found to uninstall.
  Attempting uninstall: wheel
    Found existing installation: wheel 0.34.2
    Not uninstalling wheel at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'wheel'. No files were found to uninstall.
Successfully installed Pillow-8.2.0 absl-py-0.12.0 astunparse-1.6.3 cachetools-4.2.1 certifi-2020.12.5 flatbuffers-1.12 gast-0.3.3 google-auth-1.28.1 google-auth-oauthlib-0.4.4 google-pasta-0.2.0 grpcio-1.32.0 h5py-3.2.1 idna-2.10 keras-2.4.3 keras-preprocessing-1.1.2 markdown-3.3.4 numpy-1.19.5 oauthlib-3.1.0 opt-einsum-3.3.0 protobuf-3.15.8 pyasn1-0.4.8 pyasn1-modules-0.2.8 pyyaml-5.4.1 requests-2.25.1 requests-oauthlib-1.3.0 rsa-4.7.2 scipy-1.6.2 six-1.15.0 tensorboard-2.4.1 tensorboard-plugin-wit-1.8.0 tensorflow-2.4.1 tensorflow-estimator-2.4.0 termcolor-1.1.0 typing-extensions-3.7.4.3 urllib3-1.26.4 werkzeug-1.0.1 wheel-0.36.2 wrapt-1.12.1
################################# End Task Log ################################# 
Error: Unhandled Exception: Child Task 908971192 failed: Error building image: Error fetching h2o (3.33.0.5330) source. <CRANPackageSource repo='http://cran.rstudio.org'> unable to satisfy package: h2o (3.33.0.5330)
Execution halted

I have added a sample shiny app to show you below

library(shiny)
library(h2o)

        ui <- fluidPage(

       titlePanel("TMP"),

      sidebarLayout(
         sidebarPanel(
               sliderInput("bins",
                 "Number of bins:",
                 min = 1,
                 max = 50,
                 value = 30)
            ),
  
             mainPanel(
             plotOutput("distPlot")
              )
            )
           )

        server <- function(input, output) {

         output$distPlot <- renderPlot({
  
         x    <- faithful[, 2] 
          bins <- seq(min(x), max(x), length.out = input$bins + 1)
  
          hist(x, breaks = bins, col = 'darkgray', border = 'white')
           })
        }

       shinyApp(ui = ui, server = server)

What can I do to make it work?

Thanks

1 Like