3

I have a Plotly dashboard that I am trying to turn into a executable for distribution. Pyinstaller runs without error but when I try and run the exe I get the following errors (in cmd).

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Andres\\OneDrive\\Documents\\Automation\\dashboard_tool_v2.0\\dist\\run_dashboard\\dash\\dcc\\package-info.json'
[19544] Failed to execute script 'run_dashboard' due to unhandled exception!

I use the anaconda environment so I've added the following to the spec file to assure it finds all the correct modules. I have also added numpy to the hiddenimports because in the warn-run file it says it is missing a ton of basic numpy functions. you may also see os because I have a second .py file it needs to run and I thought maybe it wasn't reading the imports on that dependency.

a = Analysis(['run_dashboard.py'],
             pathex=[('C:\\Users\\Andres\\OneDrive\\Documents\\Automation\\dashboard_tool_v2.0'),
             ('C:\\users\\Andres\\anaconda3\\lib\\site-packages')],
             binaries=[],
             datas=added_data,
             hiddenimports=['numpy','os'],
             hookspath=[],
             hooksconfig={},
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)

Any idea why it still wont run? it will simply open the python terminal and then close down after a few seconds. Also it might be noteworthy to say I tried to install with --onefile as I have a few .csv files that I want packaged together but then read that this might be an issue so I switched over to --onedir to no avail.

Andres
  • 31
  • 1
  • Can you try to use the development version of ``pyinstaller-hooks-contrib``? By ``pip install https://github.com/pyinstaller/pyinstaller-hooks-contrib/archive/refs/heads/master.zip``. To explain you can look at [this](https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/e2e31c342769fca417a31d42b204c3a323bae067) – gfdsweds Oct 02 '21 at 11:16
  • No luck, now its giving ```FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\JAVIER~1.RIC\\AppData\\Local\\Temp\\_MEI224802\\dash_daq\\package-info.json' [8172] Failed to execute script 'run_dashboard' due to unhandled exception!``` I know this is temporary folders created when running but I don't know where its getting the ```JAVIER~1.RIC``` folder – Andres Oct 04 '21 at 20:26

0 Answers0