Could not import 'btree' in MicroPython 1.9.4
Could not import 'btree' in MicroPython 1.9.4
Hello EveryOne!!
When I try to import 'btree' module in my pyboardv1.1 running MicroPython 1.9.4, I get this import error stating the absence of the module 'btree'
What am I missing?
Any help is greatly appreciated!!
When I try to import 'btree' module in my pyboardv1.1 running MicroPython 1.9.4, I get this import error stating the absence of the module 'btree'
What am I missing?
Any help is greatly appreciated!!
lnsri22
Re: Could not import 'btree' in MicroPython 1.9.4
It’s probably not compiled in; you need to define MICROPY_PY_BTREE
Sent from my iPhone using Tapatalk Pro
Sent from my iPhone using Tapatalk Pro
Re: Could not import 'btree' in MicroPython 1.9.4
Thanks jickster for the quick reply there!!
Let me give a try and update!!
Let me give a try and update!!
lnsri22
Re: Could not import 'btree' in MicroPython 1.9.4
Any progress? I couldn't help but notice that BTree is written in c. You probably need to set the right flag, recompile the micropython codebase and create your new firmware for your case.
>>> extmod/modbtree.c
Line 35: #if MICROPY_PY_BTREE
So, set the flag and recompile?
>>> extmod/modbtree.c
Line 35: #if MICROPY_PY_BTREE
So, set the flag and recompile?
Re: Could not import 'btree' in MicroPython 1.9.4
Yes that’s correct.
Sent from my iPhone using Tapatalk Pro
Sent from my iPhone using Tapatalk Pro
Re: Could not import 'btree' in MicroPython 1.9.4
Humm ... time for btree module in pure python? Than the user could simply copy the module and continue with this project.
The guys who want to have the c version, can still use the c version.
The guys who want to have the c version, can still use the c version.
Re: Could not import 'btree' in MicroPython 1.9.4
Thanks Picasso!!Picasso wrote: ↑Mon Mar 25, 2019 4:45 pmAny progress? I couldn't help but notice that BTree is written in c. You probably need to set the right flag, recompile the micropython codebase and create your new firmware for your case.
>>> extmod/modbtree.c
Line 35: #if MICROPY_PY_BTREE
So, set the flag and recompile?
Your suggestion worked like a charm!!
Sorry for the delayed update by the way
lnsri22
Re: Could not import 'btree' in MicroPython 1.9.4
The docs don't mention that btree is not normally included in a build. Should the docs say btree not included or should the build include btree?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Could not import 'btree' in MicroPython 1.9.4
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Could not import 'btree' in MicroPython 1.9.4
Thanks. Have issued pull request for documentation noting availability.