Skip to content

[BUG] Error loading dependencies #2797

Closed

Description

@WWakker

Describe your context

dash                      2.16.1
dash-bootstrap-components 1.5.0
dash-core-components      2.0.0
dash-daq                  0.5.0
dash-html-components      2.0.0
dash-iconify              0.1.2
dash-mantine-components   0.12.1
dash-table                5.0.0
  • if frontend related, tell us your Browser, Version and OS

    • OS: Windows
    • Browser Chrome

Describe the bug

I run this example app:

# Run this app with `python app.py` and
# visit http://127.0.0.1:8050/ in your web browser.


from dash import Dash, dcc, html
import plotly.express as px
import pandas as pd


app = Dash(__name__)

colors = {
    'background': '#111111',
    'text': '#7FDBFF'
}

# assume you have a "long-form" data frame
# see https://plotly.com/python/px-arguments/ for more options
df = pd.DataFrame({
    "Fruit": ["Apples", "Oranges", "Bananas", "Apples", "Oranges", "Bananas"],
    "Amount": [4, 1, 2, 2, 4, 5],
    "City": ["SF", "SF", "SF", "Montreal", "Montreal", "Montreal"]
})

fig = px.bar(df, x="Fruit", y="Amount", color="City", barmode="group")

fig.update_layout(
    plot_bgcolor=colors['background'],
    paper_bgcolor=colors['background'],
    font_color=colors['text']
)

app.layout = html.Div(style={'backgroundColor': colors['background']}, children=[
    html.H1(
        children='Hello Dash',
        style={
            'textAlign': 'center',
            'color': colors['text']
        }
    ),

    html.Div(children='Dash: A web application framework for your data.', style={
        'textAlign': 'center',
        'color': colors['text']
    }),

    dcc.Graph(
        id='example-graph-2',
        figure=fig
    )
])

if __name__ == '__main__':
    app.run(debug=True)

On startup, the app loads fine.

When I change something in my code, and the page reloads in the browser, I get the following error:
image

If I refresh the browser, the app loads again without problems.

This happens after upgrading my dash version, so could be related to a bug in the later versions.

Expected behavior

The page should reload without problems with debug=True.

Screenshots

See above

Activity

  1. WWakker commented on Mar 15, 2024

    @WWakker
    Author

    Update, when I downgrade to dash==2.15.0 it works fine. With 2.16.0 it fails again.

  2. AnnMarieW commented on Mar 15, 2024

    @AnnMarieW
    Collaborator

    @WWakker This was fixed in 2.16.1

  3. WWakker commented on Mar 15, 2024

    @WWakker
    Author

    @AnnMarieW I'm afraid I'm still experiencing the issue with 2.16.1

  4. T4rk1n commented on Mar 15, 2024

    @T4rk1n
    Contributor

    When I change something in my code, and the page reloads in the browser, I get the following error:

    It's a bug with newer version of orjson, dependencies now calls to_json for running to set components. When reloading the import on plotly.py seems to fail.
    Can uninstall orjson or import orjson at the top.

    Related to: plotly/plotly.py#3567

  5. WWakker commented on Mar 18, 2024

    @WWakker
    Author

    When I change something in my code, and the page reloads in the browser, I get the following error:

    It's a bug with newer version of orjson, dependencies now calls to_json for running to set components. When reloading the import on plotly.py seems to fail. Can uninstall orjson or import orjson at the top.

    Related to: plotly/plotly.py#3567

    I confirm this, glad that it's not related to Dash

  6. Coding-with-Adam commented on Mar 18, 2024

    @Coding-with-Adam
    Contributor

    Closing this because the issue is in Plotly.py

  7. emilykl commented on Apr 15, 2024

    @emilykl
    Contributor

    This issue should be resolved by the next Plotly.py release, now that the above linked PR has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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