{"id":7713,"library":"shiny","title":"Shiny","description":"Shiny is an open-source web development framework for Python, enabling data scientists and developers to build interactive web applications and dashboards with purely Python code. Maintained by Posit, it is under active development with frequent releases that introduce features like OpenTelemetry integration, toast notifications, AI-powered test generation, and application bookmarking. It allows for the creation of rich user interfaces that react dynamically to user input.","status":"active","version":"1.6.0","language":"en","source_language":"en","source_url":"https://github.com/posit-dev/py-shiny","tags":["web-framework","reactive","dashboard","data-science","ui","posit"],"install":[{"cmd":"pip install shiny","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Requires Python 3.10 or newer.","package":"python","optional":false},{"reason":"Shiny requires websockets>=13.0 for core functionality, with compatibility for >=14.0 introduced in v1.2.1.","package":"websockets","optional":false}],"imports":[{"symbol":"App","correct":"from shiny import App"},{"symbol":"ui","correct":"from shiny import ui"},{"symbol":"render","correct":"from shiny import render"},{"symbol":"reactive","correct":"from shiny import reactive"},{"note":"`input` is typically used implicitly within `@reactive` or `@render` functions, or directly imported from `shiny.express` for Express mode applications. In Core mode, it's passed as an argument to the `server` function.","wrong":"from shiny import input","symbol":"input","correct":"from shiny.express import input"},{"note":"Similar to `input`, `output` is implicitly available in Express mode or passed to the `server` function in Core mode.","wrong":"from shiny import output","symbol":"output","correct":"from shiny.express import output"},{"note":"Similar to `input` and `output`, `session` is implicitly available in Express mode or passed to the `server` function in Core mode.","wrong":"from shiny import session","symbol":"session","correct":"from shiny.express import session"}],"quickstart":{"code":"from shiny import App, ui, render\n\napp_ui = ui.page_fluid(\n    ui.input_slider(\"n\", \"N\", 0, 100, 20),\n    ui.output_text_verbatim(\"txt\"),\n)\n\ndef server(input, output, session):\n    @render.text\n    def txt():\n        return f\"The value of N is {input.n()}\"\n\napp = App(app_ui, server)\n","lang":"python","description":"This minimal Shiny application demonstrates a basic slider input (`ui.input_slider`) and a reactive text output (`ui.output_text_verbatim`). The `server` function uses the `@render.text` decorator to reactively display the current value of the slider."},"warnings":[{"fix":"Update test code to use `.expect_inverse(False)` and `.expect_fluid(True)` where applicable, or adapt to the new `bool` argument for `expect_inverse`.","message":"Breaking changes in `shiny.playwright.controllers` for testing. `.expect_inverse()` now requires a `bool` (use `False` for previous behavior). `.expect_layout()` was renamed to `.expect_fluid()` and also requires a `bool` (use `True` for previous behavior).","severity":"breaking","affected_versions":">=1.2.0"},{"fix":"Use the new `ui.Chat().update_user_input()` method instead, which provides similar functionality and more flexibility.","message":"The `ui.Chat().set_user_message()` method has been deprecated.","severity":"deprecated","affected_versions":">=1.1.0"},{"fix":"To view full error messages for debugging purposes, set `sanitize_errors=False` in the `App` constructor: `app = App(app_ui, server, sanitize_errors=False)`.","message":"Shiny applications, by default, sanitize error messages when deployed to prevent sensitive information leakage. This can make debugging deployed applications challenging.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Set the `SHINY_OTEL_COLLECT` environment variable to `'none'` if you wish to disable all Shiny-specific telemetry collection for sensitive operations or to reduce overhead.","message":"Starting with v1.6.0, Shiny includes OpenTelemetry integration. The `SHINY_OTEL_COLLECT` environment variable controls the default collection level (e.g., 'none', 'session'). If not explicitly set, 'session' level telemetry might be collected.","severity":"gotcha","affected_versions":">=1.6.0"},{"fix":"Double-check input IDs for typos. If an error occurs within a `@render` function, the full Python stack trace will be available in the console where `shiny run` was executed. Debug the `@render` function's logic.","message":"If an output in a Shiny app fails to render or shows a 'Missing output' error, it's often due to an attempt to read a non-existent input ID or an error within the `@render` function.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run the application locally (`shiny run app.py --reload`) to see the full stack trace, or disable error sanitization in the `App` constructor: `app = App(app_ui, server, sanitize_errors=False)`.","cause":"This is Shiny's default sanitized error message for deployed applications, hiding the underlying Python exception for security reasons.","error":"Error: An error has occurred. Check your logs or contact the app author for clarification."},{"fix":"Verify that the `id` argument in `ui.output_*` matches the name of the decorated function in `server`. Ensure that `input.some_id()` refers to an existing `ui.input_some_id` component. Check the console for any Python exceptions or tracebacks.","cause":"The output function (`@render.text`, `@render.plot`, etc.) is trying to access an input ID that does not exist or is misspelled. Alternatively, there might be a runtime error within the render function.","error":"Output not appearing (e.g., a blank space where a plot or text should be) or 'Missing output' message."},{"fix":"Always append `()` when reading the value of an `input` or `reactive.value` within `@reactive.effect`, `@render.*`, or `@reactive.calc` functions, e.g., `input.slider_val()` instead of `input.slider_val`.","cause":"Attempting to access a reactive value (like `input.some_id`) without calling it as a function (`input.some_id()`) within a reactive context.","error":"TypeError: 'ReactiveValue' object is not callable"}]}