Can't deploy tensorflow on shinyapps.io

Deployment of a shiny app on shinyapps.io is impaired
It was possible yesterday, but today I am receiving:

building: Installing system dependencies
################################ Begin Task Log ################################
[2021-01-24T08:43:42.127027605+0000] Execute script: packages/build/tensorflow.sh

  • set -e
  • curl -O https://bootstrap.pypa.io/get-pip.py
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 1883k 100 1883k 0 0 7699k 0 --:--:-- --:--:-- --:--:-- 7686k
  • python get-pip.py
    Traceback (most recent call last):
    File "get-pip.py", line 24226, in
    main()
    File "get-pip.py", line 199, in main
    bootstrap(tmpdir=tmpdir)
    File "get-pip.py", line 82, in bootstrap
    from pip._internal.cli.main import main as pip_entry_point
    File "/tmp/tmpcHnT4k/pip.zip/pip/_internal/cli/main.py", line 60
    sys.stderr.write(f"ERROR: {exc}")
    ^
    SyntaxError: invalid syntax
    ################################# End Task Log #################################
    Error: Unhandled Exception: Child Task 859227825 failed: Error building image: Build exited with non-zero status: 1
    Execution halted

Here is a minimal reprex

ui.R

ui <- fluidPage(
titlePanel("Hello World")
)

server.R

server <- function(input, output, session) {
cat("done")
}

global.R

require("tensorflow")

from sessionInfo()

R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] tensorflow_2.2.0 shiny_1.5.0

Best

1 Like

Hi,

I am getting the same issues on a non tensorflow reticulate application. Was working Saturday morning and then started to fail later the day with the same error.

Thanks!

I have the exact same issue. Started this weekend. It started with the old version of Rstudio and R that I was using. I upgraded R, RStudio, all my packages to the latest version and the problem still exists. I've upgraded Python since I read somewhere that (can't find the link now, sorry) the syntax error only happens in Python 2.4 as opposed to Python 2.7 where it works.

A possible solution (but I don't know how to change tensorflow.sh or where it is) could be instead of "curl -O https://bootstrap.pypa.io/get-pip.py" using "curl -O https://bootstrap.pypa.io/2.6/get-pip.py". This is supposed to work for older versions of Python.

Could be related to this post:

Thanks nivanovi for this update.

Indeed, it could be related to this.

Wait and see

The issue in the following link has been fixed. They upgraded Python on shinyapps.io :
Python 3.5 update for shinyapps.io

I still have the same issue occuring.

I just republished my app and my issue has been resolved. Looking at the logs I can see that python 3.8 is being used.

@nivanovi Did you try republishing? When I simply restarted the app it still failed.

I cannot publish my app because of the error. My app still works on shinyapps, I just can't publish any updates. The error is most likely related to tensorflow package (the error even mentions tensorflow.sh).

Same for me,

I still can't deploy the app (the minimal example of my 1st message)
I am getting the same error message
This seems to be linked to get-pip.py and tensorflow.sh

Now working :slight_smile:

So I am not alone !

Thanks for your feedback berno

Hope this will be fixed