dash icon indicating copy to clipboard operation
dash copied to clipboard

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

Open TheBubblePopped opened this issue 3 years ago • 1 comments

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"?

TheBubblePopped avatar Sep 17 '22 17:09 TheBubblePopped

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).

alexcjohnson avatar Sep 19 '22 14:09 alexcjohnson

@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?

AnnMarieW avatar Sep 21 '22 15:09 AnnMarieW