Micropython import works from repl but not in a script

Hi,

Not sure what I'm doing wrong. I can connect to my device and get a repl prompt, and I can “import machine” successfully, and “help(machine)” lists all the functions and stuff in the library. But if I run a script with “import machine” in it, I get an error message saying “ModuleNotFoundError: No module named ‘machine’”

I've installed the Micropython plugin (v0.2.2), installed the relevant stubs, and done all the other setup stuff as far as I can see, but I must be missing something.

I've tried with a Raspberry Pi Pico and an ESP32-S3, and the same problem occurs for both.

All advice gratefully received.

0

Please sign in to leave a comment.