-
Notifications
You must be signed in to change notification settings - Fork 1
First version of FieldTrip Python #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Thanks Johan, I will try it out! For reference, this builds on https://github.com/spm/spm-python. Since I have MATLAB 2025b on my laptop, I will initially work with Python 3.13 in a Conda evvironment. |
|
I started by creating a conda environment Then pip installed from your GH branch, resulting in Following https://github.com/spm/spm-python/blob/main/README.md, I tried option 1 (start fieldtrip, or spm), that did not work (note: not urgent right now, just writing it down for completeness). Option 2 is basically what I did. I then did So it apparently already finds the runtime which is part of my MATLAB installation and (as expected) does not need to install the runtime environment again. I then started python and Then I do I found and followed instructions here, but that did not resolve it. |
|
I tried around various things and at a certain point was warned that the matlab engine in python does not work with 3.13, so installed python 3.12 instead. That did not resolve it. |
|
I made a step forward. I installed MATLAB runtime R2025b separately from https://nl.mathworks.com/products/compiler/matlab-runtime.html and added to my DYLD_LIBRARY_PATH. When executing So I am further than I was before. However, |
|
Ah, found it in it does not print anything else and stays at this forever without obvious progress. |
|
Hi @robertoostenveld, thank you for looking into this. Regarding the runtime, I would recommend installing @balbasty/matlab-runtime through |
|
I installed When I stop it with Ctrl-C, I get this I don't know whether this means anything to you. |
|
I wonder whether it might have something to do with macOS security settings. I am reminded of this because of this issue that we also encountered on a user's computer this week. The mwpython2 loads a lot of DLLs (or the macOS equivalent). I have in my System Settings this
and I am not able to select "from Anywhere". It makes me think that perhaps it is trying to pop up a window about a permission error or limitation, but that the window does not show. |
|
Thank you for trying this. It seems that Just for reference, the Matlab Runtime is installed either independently from Matlab by downloading the installer, in which case it gets installed in Also inviting @balbasty to the discussion, in case you already came across Robert's issue before. |

Following discussions with Robert at the SPM Homecoming, I have generated a first Python wrap of FieldTrip version 20241219. As the compiled package generated by Matlab is too large to be updated on Github, it is distributed as an artefact for each release -- and should be updated and distributed through PyPI later on. For now, it can be found in the latest release in my fork. It can be installed directly using
pip:I have only tried basic functionality so far.
Please go ahead with trying the package and let me know what works and what does not!