plotly / dash

Data Apps & Dashboards for Python. No JavaScript Required.
https://plotly.com/dash
MIT License
20.87k stars 2.01k forks source link

[BUG] multi_page layout (use_pages=True) won't recognize the pages if they are compiled .pyc files. #2234

Open TheBubblePopped opened 1 year ago

TheBubblePopped commented 1 year ago

As mention in the title, it looks like dash only bats an eye for .py files. Am i doing something wrong or are .pyc files just not supported "yet"?

alexcjohnson commented 1 year ago

Right, currently we only look for .py files, but with the usual caveats about requiring a consistent Python version we should be able to expand this to accept .pyc files. Thanks for bringing this up!

If you're interested in addressing this, the relevant code is here and below:

https://github.com/plotly/dash/blob/0df861f212cbd4a55dcbf77f64c1a1bffedb0bc7/dash/dash.py#L1976

We'll need to ensure that if both .py and .pyc of the same file are present we only import one (.py would be safest).

AnnMarieW commented 1 year ago

@TheBubblePopped Can you say more about your use-case? Are you just trying to make the app load faster? Or are you doing a .pyc only distribution?