Page 1 of 1

MemoryError when loading python library

Posted: Sun Aug 14, 2022 8:49 am
by ps_nithin
When trying to load purepng "python" library in arduino nano rp2040 connect i am getting the following error.
>>> import png
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError: memory allocation failed, allocating 1016 bytes
>>>
Any ideas? How to fix this?

Re: MemoryError when loading python library

Posted: Wed Aug 17, 2022 3:03 am
by jimmo
Are you using https://github.com/Scondo/purepng directly? It's very much not designed for MicroPython.

I found this library which looks like an attempt to minify it somewhat -- https://github.com/Ratfink/micropython- ... ter/png.py

Re: MemoryError when loading python library

Posted: Wed Aug 17, 2022 1:17 pm
by ps_nithin
I was trying to adapt https://github.com/Scondo/purepng to micropython. https://github.com/Ratfink/micropython- ... ter/png.py works only partly. It doesn't allow you to write png file.
Thanks,