I am creating a multipage app with the latest dash version and trying to execute the scripts as python package. I get an error of page not found even when the pages folder exists with the relevant .py files. However, when I run the file (app.py) as a script (from Pycharm’s Run button option in the IDE), the app works fine.
Yes, moving into folder2 and then executing the code as a module works!
However, in my original project, I need to run my code from the root directory (which is equivalent to folder1 having several sub-folders). There would be problem in calling other modules if I move to the folder containing app.py for execution.
Any solution regarding how can I execute the script from folder1?
File “D:\ …\lib\site-packages\dash_labs\plugins\pages.py”, line 292, in _import_layouts_from_pages
page_module = importlib.import_module(f"pages.{page_filename}")
At the same time, I would like to point out that in Pycharm, I register_page and page_registry are not found as shown below from the editor snip. Note that still the program runs successfully (of course executed as a script or as a module from the same path). Any information on this?
Yes, this is a bug in the pages plugin. I fixed it in the pull request to add\pages to dash, but it looks like it may be a while until that PR is reviewed. I’ll do a PR to fix it in dash-labs as well.
@AnnMarieW This bug you mentioned 2 posts up (in 2022) is solved I guess?
I am running into some issues with pages not being found, but the likelihood is high that I made a coding mistake. I am looking for clues in the forum right now.