fooof_mat
fooof_mat copied to clipboard
Python Error: AttributeError: 'array.array' object has no attribute 'fromstring'
Hi There, I'm new to MatLab and Python..
Thanks for this foof code!
I'm using MatLabR2020a and have Pythern version 3.9.2 installed.
I'm receiving the following error:
fooof_results = fooof(freqs, power_spectrum, f_range, settings, return_model); Python Error: AttributeError: 'array.array' object has no attribute 'fromstring'
Does anyone have any advice as to what this means/how I can fix this?
Hey, I got the same error. I solved it downgrading to Python 3.6.
Thanks for the update @JuliusWelzel! Sorry for not getting back to the original post @AMMDR - Matlab / Python errors can be difficult to debug, and I didn't initially know what was going on here. I would recommend downgrading Python and seeing if that helps. If anyone figures out any more details on which details worked, or what changed to create this issue, please let us know, and we can try and add some notes about it.
Also, as a general reminder, once you have Python installed, the https://github.com/fooof-tools/mat_py_mat approach can also be used to integrate spectral parameterization into a Matlab workflow.
Hi @JuliusWelzel and @TomDonoghue thanks so much for the help. Downgrading to Python 3.6 did the job! What a weird one!
Just got the same and found this related info: https://www.mathworks.com/matlabcentral/answers/638735-matlab-numpy-array-attributeerror-array-array-object-has-no-attribute-fromstring
@TomDonoghue I recommend mentioning in the install that 3.6 should be used. Sidenote: I also needed to follow this to make MATLAB recognize the Anaconda install (Win 10): https://www.mathworks.com/matlabcentral/answers/502458-why-can-py-numpy-array-not-be-resolved, maybe worth mentioning, too :)
same error here! Anyone has a tip for me how I can downgrade my python 3.10 to 3.6?
I got this error from as unrelated project, not sure if it is related: https://discourse.panda3d.org/t/attributeerror-array-array-object-has-no-attribute-fromstring-when-using-setup-py/26759
It looks like Python 3.9 removed fromstring(). You could manually fix the file in question or try Python 3.8. We need to fix this in the next version of Panda3D.
This is inline with what @MariusKlug said. so probably downgradeing would work. I am looking for alternatives
Hi Tom,
Since python version 3.6 is not supported anymore. Do you have any updated m file to solve this problem? I am using the Matlab-Python approach. Thanks.