Currently, we include micropython-lib with its standard Buildroot settings. However, in profile.d/python_path.sh, we set MICROPYPATH, and unlike with CPython, that is an override, not an addition.
The obvious solution would be to change that line to
export MICROPYPATH="/mnt/builtin/lib/micropython:.frozen:~/.micropython/lib:/usr/lib/micropython"
so we can keep the original path. However, because of bugs in buildroot and micropython-lib, that wouldnʼt be ideal.
I suggest waiting for the 2026.02 Buildroot release, which probably wonʼt have a fix because itʼs so late in the development cycle, but if it does would make things much simpler.
If it isnʼt fixed upstream, we might want to manually remove /usr/lib/micropython/re.py and /usr/lib/micropython/json from the image (the only other shadowed library we use is select which doesnʼt look like it can cause a problem) and make the MICROPYPATH change. Alternately, it might make sense to decide not to support micropython-lib at all, but I would prefer a different option because having eg. argparse is useful.
Currently, we include
micropython-libwith its standard Buildroot settings. However, in profile.d/python_path.sh, we setMICROPYPATH, and unlike with CPython, that is an override, not an addition.The obvious solution would be to change that line to
so we can keep the original path. However, because of bugs in buildroot and micropython-lib, that wouldnʼt be ideal.
I suggest waiting for the 2026.02 Buildroot release, which probably wonʼt have a fix because itʼs so late in the development cycle, but if it does would make things much simpler.
If it isnʼt fixed upstream, we might want to manually remove
/usr/lib/micropython/re.pyand/usr/lib/micropython/jsonfrom the image (the only other shadowed library we use isselectwhich doesnʼt look like it can cause a problem) and make theMICROPYPATHchange. Alternately, it might make sense to decide not to supportmicropython-libat all, but I would prefer a different option because having eg.argparseis useful.