Giter Club home page Giter Club logo

dash_by_exe's Introduction

Plotly Dash, hello word example, locally hosted by waitress, compiled into an .exe with Pyinstaller.

Set up to include data for dashboard, including and image in the dashboard and setting the .exe icon.

Dash example

Pyinstaller

After cloning repository install the packages required

pip install -r requirements.txt

Edit file paths for your system

Set the paths in app_onedir.spec under pathex and datas to be suitable for your system.

To create exe

run pyinstaller app_onedir.spec in terminal. The application is written to the dist folder. Double click the launch_app.exe to run the dashboard locally.

Note

Using app_onedir.spec creates a folder with exe inside. It is possible to create a single .exe with pyinstaller using the appropriate configuration in the .spec, but it is slow to open.

Useful links

pkg_resources.DistributionNotFound: The 'flask-compress' distribution was not found and is required by the application [3400] Failed to execute script app Use code from SO answer to do monkey patch. Change correct version number. See fix in utils folder. Run pip show flask-compress to get version number.

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\douwm\AppData\Local\Temp\_MEI63602\dash_core_components\package-info. json' [6304] Failed to execute script app https://community.plotly.com/t/pyinstaller-error-when-executing-plotly-dash-exec-file/34126/10 answer by schan: Have to add path of dash_core_components and other to .spec file Make a app.spec and specify the path of the packages

https://stackoverflow.com/questions/56758159/attributeerror-frozenimporter-object-has-no-attribute-filename Debug should be False in app.py when not debugging (Production)

To serve the app with waitress https://community.plotly.com/t/can-i-use-dash-plotly-in-production-environment/13541/5 http://127.0.0.1:8080/ % Go this when running server script

To go to the url automatically when running the exe, we let sleep and then open with web broweser as recommended: https://stackoverflow.com/a/60957363/13372470

Include an assets file for dash https://stackoverflow.com/questions/51264169/pyinstaller-add-folder-with-images-in-exe-file/51266275 Make sure the path in .spec file is correct for system

Delete things in app folder until app does not work to reduce size see reduce_file_size.txt for files that could be removed

To add an icon to the exe See spec file in exe section

onefile.spec is slow, rather use onedir and then hide the files that the user wil not interact with.

For ofline running, first download the css file you want to use and put it in assets https://stackpath.bootstrapcdn.com/bootswatch/4.5.2/darkly/bootstrap.min.css (for example)

dash_by_exe's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.