Skip to content

JonThom/dash-background-callbacks-pyinstaller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dash background callbacks with pyinstaller

A working example of packaging a Plotly Dash app with background callbacks using PyInstaller. Tested on macOS, should work cross-platform. Based on toy example at plotly/dash#1885 (comment).

quick start

git clone the github repo and cd into the project directory. Then

create and activate a virtual environment

python3 -m venv .venv
source .venv/bin/activate

install the dependencies

pip install -r requirements.txt

Make a .spec specification file for the build. See the PyInstaller docs for options.

pyinstaller main.py

in the new main.spec file, add the following to the datas in Analysis

a = Analysis(
    ...,
    datas=[
        ('long_callbacks', 'long_callbacks'),
        ('cache', 'cache')
    ],
    ...
)

build the app bundle

pyinstaller --noconfirm main.spec

run the app by running the executable or app bundle in the dist directory (depends on OS and build specs)

# e.g., on macOS
./dist/main/main

About

Plotly Dash background callbacks, packaged in a desktop app using pyinstaller. Minimal working example.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages