Skip to content

[BUG] Error loading dependencies #2797

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
WWakker opened this issue Mar 15, 2024 · 7 comments
Closed

[BUG] Error loading dependencies #2797

WWakker opened this issue Mar 15, 2024 · 7 comments

Comments

@WWakker
Copy link

WWakker commented Mar 15, 2024

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

@WWakker
Copy link
Author

WWakker commented Mar 15, 2024

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

@AnnMarieW
Copy link
Collaborator

@WWakker This was fixed in 2.16.1

@WWakker
Copy link
Author

WWakker commented Mar 15, 2024

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

@T4rk1n
Copy link
Contributor

T4rk1n commented Mar 15, 2024

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

@WWakker
Copy link
Author

WWakker commented Mar 18, 2024

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

@Coding-with-Adam
Copy link
Contributor

Closing this because the issue is in Plotly.py

@emilykl
Copy link
Contributor

emilykl commented Apr 15, 2024

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants