Unable to import machine module

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
User avatar
Ventran
Posts: 19
Joined: Sun Jun 21, 2020 4:28 pm
Location: Poland, Europe

Unable to import machine module

Post by Ventran » Wed Sep 23, 2020 9:52 am

Hello,
Why my VS Code IDE showing error message: Unable to import machine module?
import-err.PNG
import-err.PNG (30.51 KiB) Viewed 682 times

User avatar
Roberthh
Posts: 2222
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Unable to import machine module

Post by Roberthh » Wed Sep 23, 2020 2:32 pm

Because the machine module does not exist in CPython. You can ignore that warning.

stijn
Posts: 504
Joined: Thu Apr 24, 2014 9:13 am

Re: Unable to import machine module

Post by stijn » Wed Sep 23, 2020 2:46 pm

This has been asked here before if I remember correctly, there are 'fake' machine modules available which CPython can use to get an idea of what the machine module does on MicroPython. Search the forum (or something else) for 'typesheds'.

Alternatively you might be able to instruct pylint to ignore those specific modules, not sure if it can do that.

Post Reply