fooof-tools / fooof_mat

A Matlab wrapper for spectral parameterization.
MIT License
41 stars 20 forks source link

Unable to resolve the name 'py.fooof.FOOOF' #29

Open yhashim opened 1 year ago

yhashim commented 1 year ago

Hi, I followed the README and installed dependencies. I have MATLAB (9.14.0.2286388 (R2023a) Update 3) and Python (3.10.6). I tried running my own scripts, as well as all of the example .mat files and run into this error:

Unable to resolve the name 'py.fooof.FOOOF'.

Error in fooof (line 48)
    fm = py.fooof.FOOOF(settings.peak_width_limits, ...

Any help would be appreciated. Thanks in advance.

edwardwl commented 1 year ago

I'm having the same issue

nb-bu commented 9 months ago

Hi both! I run into the same error... did you happen to find a solution or a workaround during the past months since this issue was opened?

I'm using Matlab 2023b on a Mac (M1). Have tried both with Anaconda and now more recently with the "normal" Python 3.10 from python.org. Matlab's pyenv recognizes the correct Python version and (after some troubleshooting) finally lets me use numpy; but still can't recognize fooof (shooting the same error as above), even though it's installed in the correct folder.

nb-bu commented 9 months ago

Update: While this issue has not been solved, I was able to run fooof now via Matlab (and anaconda-installed Python) on an older (2019) MacBook Air that has an Intel chip. So it might possibly be an issue with Apples M1 chip.

lmcrown commented 8 months ago

I was having the same issue and then I did this in matlab and it worked! py.importlib.import_module('fooof')

Ehealey94 commented 6 months ago

Anyone manage to solve this? Python is working fine in MATLAB (I have 3.9 installed), but I get the same error message as above.

I have also tried py.importlib.import_module('fooof'), as suggested by @lmcrown, but get the following error message too: Error using _backend_tk> Python Error: RuntimeError: Failed to load Tcl_SetVar

It's curious as I have managed to run the fooof tool on a prevoius dataset with no trouble, so any help here would be greatly appreciated!

danielmontgomery7 commented 3 months ago

I also had this problem. I was able to solve it by installing matplotlib, as mentioned in #30