Black Lives Matter. Please consider donating to Black Girls Code today.

PyInstaller error when executing Plotly Dash .exec file

I am trying to create a .exe file to run a python dashboard created with Plotly Dash. Once I create the file with PyInstaller and try to run it, I get this error:

Traceback (most recent call last):
  File "app.py", line 2, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/Users/mohamedmartino/opt/anaconda3/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages/dash_core_components/__init__.py", line 12, in <module>
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/np/m30g9mj57h72n68qxc2tq61m0000gn/T/_MEI2yKNs4/dash_core_components/package-info.json'
[85571] Failed to execute script app

I’m new to coding, and I can’t figure out why it can’t find the dcc dependency. Is there a better way to compile my modules into one executable file?

I have a few python modules and excel files in the same directory as well as an -asset folder with images and css files.

Hi @mmartino, did you take a look at this previous discussion Convert Dash to executable file (.exe) ? Maybe it can help.

Did you manage to create the exe file with PyInstaller? I’m going to be done my app in a couple months and the thought of not being able to make an exe file scares the life out of me. If you did succeed, does the browser open by itself on execution of the file? or do you have to manually navigate to a specific location. Thx

Unfortunately, I was not able to turn this into an executable app. To create my reports, I just run my code through the terminal. If you’re able to make this executable for any user, I’d be interested in learning how you did it.