I'm trying to use pyinstaller (latest version) to package D-table as an EXE file, but I'm getting this error:
FileNotFoundError: No such file of directory: ...\dash_colorscales\metadata.json.**
FileNotFoundError: No such file of directory: ...\dtale\translations.
I have tried to use a hook file as below, but still it didn't work.
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
hiddenimports = collect_submodules('dtale')
datas = collect_data_files('dtale', include_py_files=True)
How can I fix this?
Here is my main.py file:
import dtale
if name == 'main':
dtale.show().open_browser()
app = dtale.app.build_app(reaper_on=False)
app.run(host="0.0.0.0", port=8080)
You need to add all of the
jsonandjsfiles from thedash_daqanddash_colorscalesas data with the compiled contents.These are the steps I took to compile and run the application.
Open a new directory and
cdinto it.Create a clean virtual env with
python -m venv venvand activate it withvenv\scripts\activateInstall dependencies with
pip install dtale pyinstallerI copied the example code from the dtale GitHub page into a
main.pyfilemain.pyRun
pyinstaller -F --collect-all dtale main.pyInside of the created
.specfile, add the following lines at the top.Run
pyinstaller main.specRun
dist/main.exeAnd Bob’s your uncle.