A folder called pages does not exist (pyinstaller)

Hello!
I have built my first dash application. It was intended to be executed in the local server. I wanted to share it with a collegue for him to execute it in its local server. I was trying to create a .exe using pyinstaller. I have successfully done it with a dummy application (which works fine). When creating the .exe with my app it constantly shows the following message:

The structure of my project is something like:

Project
/.venv
/assets
/pages
app.py

I specify the pages dir in the constructor, but I keep getting the same error and I don’t really know what else to try…

Thank you in advance!

from dash import Dash, html, page_container
import dash_bootstrap_components as dbc
import os

# Defining the app
pages_folder = os.path.join(os.path.dirname(__name__), "pages")
app = Dash(
    name=__name__,
    use_pages=True,
    pages_folder=pages_folder,
    external_stylesheets=[dbc.themes.SIMPLEX, dbc.icons.BOOTSTRAP],
    suppress_callback_exceptions=True,
)

# App layout
app.layout = html.Div([page_container])

# Running the app
if __name__ == "__main__":

    # Run server
    app.run(debug=True)

Hi @aguinda

You may find this helpful:

Then, since you are using the default name for the pages folder, you can remove this line:

pages_folder=pages_folder,