microbit-foundation / micropython-microbit-v2

Temporary home for MicroPython for micro:bit v2 as we stablise it before pushing upstream
MIT License
42 stars 23 forks source link

`neopixel` module not included in the latest CI builds #101

Closed microbit-carlos closed 2 years ago

microbit-carlos commented 2 years ago

Originally reported by @GrandpaBond in https://github.com/bbcmicrobit/PythonEditor/issues/397.

@dpgeorge Looks like something is going wrong packaging the frozen neopixel python module.

Using the latest hex from the CI: https://github.com/microbit-foundation/micropython-microbit-v2/actions/runs/2372009656

MicroPython 569e361 on 2022-06-20; micro:bit v2.0.0 with nRF52833
Type "help()" for more information.
>>> help('modules')
__main__          love              neopixel          ucollections
antigravity       machine           os                uerrno
audio             math              radio             urandom
builtins          microbit          speech            ustruct
gc                micropython       this              usys
log               music             uarray            utime
Plus any modules on the filesystem
>>> import neopixel
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'neopixel'
>>> 

@microbit-matt-hillsdon tagging you for visibility, as this problem is present in the MicroPython hex used in https://python.microbit.org/v/beta

microbit-matt-hillsdon commented 2 years ago

Thanks Carlos. I just tried an older editor branch and it works there, so upgrading from this CI build to this one broke it (done for data logging on 2.2 devices on https://github.com/microbit-foundation/python-editor-next/pull/790).

Also raised on support: https://support.microbit.org/a/tickets/54892

microbit-matt-hillsdon commented 2 years ago

Another support request: https://support.microbit.org/a/tickets/54943

jaustin commented 2 years ago

@dpgeorge did you get a chance to look at what was causing this? As we push more users to the beta editor it's going to be increasingly reported and get in people's way.

(we're about to make the banner on the old that encourages people to try the beta editor much more visible!)

florenthemmi commented 2 years ago

Same issue here! Have to use the old editor here: https://python.microbit.org/v/2

(Difficult to find the right place to give a feedback on this...)

dpgeorge commented 2 years ago

This was due to the update to MicroPython v1.18, which requires ".frozen" to be added to sys.path so frozen modules (like neopixel) can be found. It is now fixed by 1af1498ae01ca4b4ff6dfe3511738747e5cd4bf9

microbit-matt-hillsdon commented 2 years ago

@florenthemmi I've updated MicroPython in the beta Python Editor to the version with this fix so the neopixel module should work for you now.

Let me know if you see any issues and thanks for getting in touch with your feedback. This was the perfect issue to comment on, but if it's ever unclear then feel free to use the feedback option on the help menu in the app or open a support request at https://support.microbit.org/