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.
May I ask what use case youāre trying to address?
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?