Skip to content
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

Python Error: AttributeError: 'array.array' object has no attribute 'fromstring' #22

Open
AMMDR opened this issue Apr 1, 2021 · 7 comments

Comments

@AMMDR
Copy link

AMMDR commented Apr 1, 2021

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?

@JuliusWelzel
Copy link

Hey, I got the same error. I solved it downgrading to Python 3.6.

@TomDonoghue
Copy link
Member

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.

@AMMDR
Copy link
Author

AMMDR commented Apr 13, 2021

Hi @JuliusWelzel and @TomDonoghue thanks so much for the help. Downgrading to Python 3.6 did the job! What a weird one!

@MariusKlug
Copy link

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 :)

@KarlHerold
Copy link

same error here! Anyone has a tip for me how I can downgrade my python 3.10 to 3.6?

@mnumanuyar
Copy link

mnumanuyar commented Aug 10, 2022

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

@michaelhello007
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants