Skip to content

IPython dependency mess leads to drastic make-or-break behavior changes in simple Shiny Express apps #201

Closed
@pfalcon

Description

@pfalcon

Very simple Shiny Express code can either magically work, or magically not work, depending on whether shinywidgets package is installed. Steps to reproduce:

  1. Create 2 virtual environments, venv1, venv2. Let's assume 2 terminal windows. In 1st:
cd tmp
python3 -m venv venv1
source venv1/bin/activate

Similarly for for venv2.
2. In venv1, install:

pip install shiny plotly[express] pandas
  1. In venv2, install:
pip install shiny plotly[express] pandas shinywidgets
  1. Use following simple app:
import plotly.express as px
from shiny.express import input, ui

ui.input_slider("n", "Number of sth", 1, 100, 20)

fig = px.line(x=[1, 2, 3], y=[4, 1, 2])
fig
  1. Run in venv1, and observe that a plot is properly rendered:
shiny run -r -b plot_ex.py
  1. Now run in venv2, and observe that a plot isn't rendered:
shiny run -r -b plot_ex.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions