fooof_mat icon indicating copy to clipboard operation
fooof_mat copied to clipboard

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

Open yhashim opened this issue 2 years ago • 6 comments

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.

yhashim avatar Jul 05 '23 18:07 yhashim

I'm having the same issue

edwardwl avatar Aug 28 '23 23:08 edwardwl

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 avatar Jan 17 '24 18:01 nb-bu

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.

nb-bu avatar Jan 30 '24 16:01 nb-bu

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

lmcrown avatar Feb 29 '24 23:02 lmcrown

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!

Ehealey94 avatar May 09 '24 16:05 Ehealey94

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

danielmontgomery7 avatar Jul 30 '24 16:07 danielmontgomery7