Skip to content

Read this if outputs are not working in your app #929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wch opened this issue Dec 19, 2023 · 0 comments
Closed

Read this if outputs are not working in your app #929

wch opened this issue Dec 19, 2023 · 0 comments

Comments

@wch
Copy link
Collaborator

wch commented Dec 19, 2023

If you have taken code from an example and the outputs are not working, it may be because you need an updated version of Shiny.


Perhaps your app is supposed to look like this, with a plot

image

But instead it looks like this, where there's nothing in the place of the plot:

image

In Shiny 0.6.0, released on 2023-10-03, we changed Shiny so that the @output decorator is no longer needed. In the current development version of Shiny (after the 0.6.1 release), we have updated the examples so that they no longer use the @output decorator (#790).

# Old version of code examples
@output
@render.plot
def plt():
    ...


# New version of code examples
@render.plot
def plt():
    ...

If you have copied and pasted code that does not have @output, and are using Shiny 0.5.1 or older, then you might have the problem shown in the screenshot above. (You check your Shiny version at the Python console by running import shiny; shiny.__version__.)

To fix the problem, either:

  • Update to a newer version of Shiny (at least 0.6.0)

  • or add @output above the render decorators, as in:

    @output
    @render.plot
    def plt():
        ...
@wch wch pinned this issue Dec 19, 2023
@wch wch changed the title Output are not working Outputs are not working Dec 19, 2023
@wch wch changed the title Outputs are not working Read this if outputs are not working in your app Dec 19, 2023
@wch wch closed this as completed Mar 5, 2024
@wch wch unpinned this issue Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant