Skip to content

name 'ls' isn't defined #32

Answered by Carglglz
stas-sl asked this question in Q&A
Oct 7, 2022 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

@stas-sl
Hi, TLDR: add these lines of code in boot.py or main.py

import sys
sys.path[:] = ['', '/lib', '/', '.frozen']

And that should fix it.

This happens because MicroPython recently started to include its version of upysh.py as a frozen module i.e .frozen , you can see this with

esp8266@esp8266:~ $ modules
__main__          math              ucollections      ure
_boot             micropython       ucryptolib        urequests
_onewire          neopixel          uctypes           urllib/urequest
_uasyncio         network           uerrno            uselect
_webrepl          ntptime           uhashlib          usocket
apa102            onewire           uheapq            ussl
btree      …

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@stas-sl
Comment options

@Carglglz
Comment options

Answer selected by stas-sl
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants