If you have a question or issue with MNE-Python, please include the following info:
MNE-Python version: 0.22.0
operating system: Windows
Hi @larsoner and @richard ,
I tried to generated with pyinstaller a .exe of a script containing MNE , and it get built fine, but once I run MNE it from the .exe I receive the error: “montage\standard_1085.elc not exist”.
Are some of you familiar with this issue? I believe that a solution of this issue could be extremely useful to MNE users.
In particular would be really useful to know how to customize the .spec file in order to fix the issue, for example specifying in the “hidden import” field this missing file, but it is just an rough idea.
With your help I’m sure we could find a solution, and I will be so thankful and glad to help to generate a quick guide to solve this issue and get the .exe fully working.
unfortunately I won’t have much time to look into details, but I’m quite certain you’ll have to to supply the datas parameter to Analysis in order to include those non-Python files in the installer bundle.
thanks @richard …sorry I referred to “standard_1005.elc”.
I will try to add it in someway through the “data” to be added in the .spec and I’ll let you know how it works.
I will try to use this file:
This is the block in my script that is related to the issue
# If EEG channels use the standard naming strategy, By supplying the 'montage' parameter, approximate locations will be added for them
montage = 'standard_1005' # importante se voglio plottare la location dei canali
info.set_montage(montage) # Initialize required fields
info['description'] = 'EEG analysis' # Optional, general description of the project
May I ask what use case you’re trying to address?
Sure!!! I love to make standalone that can run on my laptops where python is not installed.
In this case it would allow me to run the EEG analysis without an IDE and python. Alternatively I should keep all my laptops updated in term of python packages version but it is too time consuming, most of the times packages are outdated or too updated and generate errors…I don’t want to deal with it anymore, I find this solution with pyinstaller that it is much more convenient to use once you reach the end with your script.
I will make some trial in the next days! I’ll keep this thread updated, if you or @larsoner could share some more ideas I will try to follow them, thank you
I’ve been working a bit on stand-alone MNE-Python installers that should make it very simple to install and update MNE. Do you think this could help you?
thanks @richard I really appreciated but I’m aiming to generate the standalone using pyinstaller.
I have some more updates. First of all, looking at the program files of the standalone I noted that:
Not only "mne/channels/data/montages/standard_1005.elc " file is not present, but the entire mne folder is not present, that’s why I did some more tests with pyinstaller, specifying in the ‘hidden import’ field of the .spec file that mne have to be imported. An example below, of how I added it in the .spec file:
a = Analysis(
hiddenimports=["mne"],
.....
However it doesn’t work… mne is not imported. Reading a bit the pyinstaller site, it looks like that the main issue is that mne, unlike other packages/modules, doesn’t have a pyinstaller hook. Pyinstaller website states:
At the moment I cannot unfortunately therefore move forward, I’m stacked @richard do you know someone in this great MNE community that ever tried to use pyinstaller with MNE and that could share some ideas about this issue? I’ve seen that @larsoner in this file was adding some code related to pyinstaller, maybe he knows something about that?