Problem creating app with pyinstaller and mne 0.24

  • MNE 0.24.0
  • Mac OS 11.6.1

I had no problems using pyinstaller to create apps that incorporated mne until upgrading to mne 0.24. Now, when trying to build my app, I receive an error message:

FileNotFoundError: [Errno 2] No such file or directory: '/Users/fishbacp/Desktop/Python/dist/My_Application.app/Contents/MacOS/mne/report/js_and_css/report.js

Although I’ve experimented with adjusting my pyinstaller options (done in a .spec file), I’ve found that the only way to overcome this problem is to uninstall mne 0.24 and downgrade to 0.23.4

I realize this is not a forum for pyinstaller, but is anyone aware of differences between these two mne versions that might explain this error message?

Hello, report.js Is new in MNE 0.24. be sure to include it on your bundle.

Best,
Richard

Thanks. I modified my spec file so that report.js could be found, and the pyinstaller building process was successful. However, I was unable to run the executable from the command line. due to the following error:

Traceback (most recent call last):
  File "main_app_11_28.py", line 4, in <module>
    import mne
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "PyInstaller/loader/pyimod03_importers.py", line 476, in exec_module
  File "mne/__init__.py", line 22, in <module>

From there, the error message included several similar blocks, but with the last line changing from mne/__init__.py to mne/utils/__init__.py, then mne/utils/check.py, and mne/fixes.py. Following this there were several similar blocks but with mne replaced by numba, which I do have installed. The last line read “MemoryError.”

If this issue is one better suited for the pyinstaller group, just let me know.

Hello, you can try to simply not include numba – it’s not a hard requirement for MNE-Python.

You can probably more get help at a specific pyinstaller forum, yes :slight_smile: