Installing and Setting Up Shinylive for Python

Guide to Install the shinylive Python Package and Configure Asset Management

Learn how to install the shinylive Python package from PyPI and set up asset management to run interactive Shiny for Python apps using WebAssembly.

Tools
Author
Affiliation
Published

March 20, 2025

Keywords

shinylive installation Python, serverless Shiny setup Python, Python shinylive

Introduction

Shinylive for Python enables you to run Shiny applications written in Python entirely in the browser—without a dedicated server—by leveraging WebAssembly. This tutorial will guide you through installing the shinylive Python package and configuring asset management, so you can easily convert your Shiny for Python apps into static, serverless web applications.



1. Installing the shinylive Python Package

There are two main ways to install the shinylive Python package:

Option 1: Install from PyPI

The easiest method is to install the package from PyPI using pip. Open your terminal or command prompt and run:

pip install shinylive --upgrade

This command installs the latest stable release of shinylive.

Option 2: Install from GitHub

If you need the development version or the latest features, you can install shinylive directly from GitHub:

pip install git+https://github.com/posit-dev/py-shinylive.git
Note

Choose the option that best suits your needs.

2. Configuring Asset Management

Shinylive automatically downloads the web assets (HTML, JavaScript, CSS, and WASM files) required to run your Shiny for Python apps in the browser. These assets are cached locally to speed up subsequent loads.

Checking Asset Information

To verify that the assets are correctly installed, run the following command in your terminal:

shinylive extension info
Note

This command will display the version of the shinylive package, the version of the web assets, and their cache paths.

Updating and Cleaning Assets

  • Download/Update Assets:
    If you need to update to a specific asset version, you can use the CLI to download it. For example, consult the documentation using:

    shinylive extension language-resources
  • Cleaning Up Old Assets:
    Periodically, you may want to clean up outdated assets. Refer to the package documentation for cleanup commands.

3. Verifying Your Setup

After installation, confirm that everything is set up properly by running:

shinylive --help
Note

This command shows you a list of available commands and options, confirming that shinylive is ready to use.

Further Reading

Conclusion

With the shinylive Python package installed and asset management configured, you’re ready to convert your Shiny for Python apps into interactive, serverless web applications. Follow the further reading links for more detailed tutorials on creating and embedding Shinylive apps, and enjoy the power of running Shiny apps directly in your browser!

References

Back to top

Reuse

Citation

BibTeX citation:
@online{kassambara2025,
  author = {Kassambara, Alboukadel},
  title = {Installing and {Setting} {Up} {Shinylive} for {Python}},
  date = {2025-03-20},
  url = {https://www.datanovia.com/learn/interactive/python/shinylive/installation.html},
  langid = {en}
}
For attribution, please cite this work as:
Kassambara, Alboukadel. 2025. “Installing and Setting Up Shinylive for Python.” March 20, 2025. https://www.datanovia.com/learn/interactive/python/shinylive/installation.html.