Open dlavrent opened 6 months ago
I believe the error message you're seeing is related to the app being a Shiny Express (as opposed to Shiny Core) app.
Just to make sure it has something to do with Shiny Express: Have you tried deploying a Shiny Core app? Here is a basic one you can use:
from shiny import App, render, ui
app_ui = ui.page_fixed(
ui.input_slider("val", "Slider label", min=0, max=100, value=50),
ui.output_text_verbatim("slider_val")
)
def server(input, output, session):
@render.text
def slider_val():
return f"Slider value: {input.val()}"
app = App(app_ui, server)
Thank you -- I tried deploying a Core version of the basic slider app and it works just fine.
I converted a more complicated Express app to Core and now that works fine too.
It seems that Shiny Server Open Source does not yet support for Shiny Express apps. However, you can actually wrap your Shiny Express app so that it looks like a Shiny Core app.
If you name your Shiny Express app file from above express_app.py
, and then add the following file as app.py
, it should work:
## app.py ##
from pathlib import Path
from shiny.express._run import wrap_express_app
# Create a shiny.App object from the Shiny Express app file
app = wrap_express_app(Path(__file__).parent / "express_app.py")
Shoot, that’s quite an oversight, sorry. I’ll add it to the list.
PR is here: https://github.com/rstudio/shiny-server/pull/566
Hello -- I am trying to deploy a basic py-shiny app on an Oracle Cloud virtual machine (aarch64, Ubuntu 22.04) but am running into the following error when I try to access my app on another computer at
<my-virtual-machine-ip>:3838/my_shiny_apps/basic-app/
The
app.py
that I am trying to deploy:In case it's useful, my
/etc/shiny-server/shiny-server.conf
has the following lines pointing to a virtual environment that I am wondering is what is causing the issue:However, if in my virtual machine I activate my virtual environment and run the app locally,
shiny run -h 0.0.0.0
, then I can access my app from another computer's browser just fine when I connect to<my-virtual-machine-ip>:8000
.I see that someone else has posted this error in recent days as well: https://community.rstudio.com/t/problem-with-deploying-example-app-with-shiny-server-module-app-has-no-attribute-app/181974
I'd appreciate any guidance! This is my first foray into using virtual machines/ARM processors too.
My virtual environment uses python 3.10.13 and shiny 0.7.1.