cannot load machine library #18048
Replies: 12 comments 10 replies
-
|
suspect number one is that you did not set the python interpreter in Thonny to be the MicroPython (Raspberry Pi Pico). Its under Thonny>Settings on my mac or Tools>Options when I run Thonny from a rpi5. |
Beta Was this translation helpful? Give feedback.
-
|
I checked that first and it says Micropython (Raspberry Pi Pico) - Board
CDC @ COM 3
…On Mon, Sep 8, 2025 at 6:56 PM Bg ***@***.***> wrote:
suspect number one is that you did not set the python interpreter in
Thonny to be the MicroPython (Raspberry Pi Pico). Its under Thonny>Settings
on my mac or Tools>Options when I run Thonny from a rpi5.
—
Reply to this email directly, view it on GitHub
<#18048 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXDL567O6OZLYQZ5GBO24SD3RYJSNAVCNFSM6AAAAACF656ZQCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIMZUGUZTKNA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
I checked that first and it says Micropython (Raspberry Pi Pico) - Board
CDC @ COM 3
…On Tue, Sep 9, 2025 at 2:52 AM JackCode0011 ***@***.***> wrote:
Check Thonny on the bottom right corner. There you should see your Pico
and which COM-port it uses. Only then Thonny is running your code as
micropython with the Pico.
—
Reply to this email directly, view it on GitHub
<#18048 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXDL562S3PWFGUVCGFZ7EAT3R2BLRAVCNFSM6AAAAACF656ZQCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIMZUHA2TCNQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
Importing machine is in all likelihood the most basic functionality one can imagine. Thonny on the other hand is tool to help the uninitiated with problems they wouldn't have without it. In other words, try without Thonny and all will be well… |
Beta Was this translation helpful? Give feedback.
-
|
I just opened Thonny to see if there is a problem.
When updated, the board reboots and the command In case there is garbage on your Pico you can download flash_nuke.uf2 first to restart with a virgin Pico |
Beta Was this translation helpful? Give feedback.
-
|
I tried running a very simple program to flash an LED and it didn't work
when I used " import machine" but when I changed it to"from machine import
Pin " it worked. I made the same change to my original program but it still
didn't work. I am using Thonny but I suspect it's causing the problem so I
am going to try a different IDE. Which one would you suggest?
…On Fri, Sep 12, 2025, 4:17 AM JackCode0011 ***@***.***> wrote:
I agree. Thonny is really well designed for beginners and easy to use. But
you often encounter problems with it that are unfortunately caused by
Thonny and do not occur with other IDEs. And it crashes to often...
—
Reply to this email directly, view it on GitHub
<#18048 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXDL56ZFBKQUOAQIGDA5DA33SKFRDAVCNFSM6AAAAACF656ZQCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIMZYGI2TMMI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
If I use "import machine" it never gets past that statement.
…On Fri, Sep 12, 2025, 9:54 AM Norbert ***@***.***> wrote:
if you do a import machine, then you have to use machine.Pin(…)
whereas if you do a from machine import Pin, you can use Pin(…)
Could that be your problem?
—
Reply to this email directly, view it on GitHub
<#18048 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXDL564E2H6QUQMOI5ZTFTD3SLNBXAVCNFSM6AAAAACF656ZQCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIMZYGU2TINA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
.The I get just says "MPY: soft reboot". And then if I goto "Visualize
current script at Python Tutor" it shows me the error "ImportError: machine
not found or not supported"
…On Fri, Sep 12, 2025, 11:52 AM Norbert ***@***.***> wrote:
You mean like that:
>>> MPY: soft rebootMicroPython v1.26.0 on 2025-08-09; Raspberry Pi Pico2 with RP2350Type "help()" for more information.>>> import machine>>>
—
Reply to this email directly, view it on GitHub
<#18048 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXDL567NNU6VP2EMOF6XH5D3SL24TAVCNFSM6AAAAACF656ZQCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIMZYGY2DQMY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Python Tutor doesn't know MicroPython dont' t use it. The simplest way to test this import with Thonny is to click in the "Shell" tab and enter the following at the command line The dir command should display all the functions and classes that are in the machine module. To test a program with Thonny,
|
Beta Was this translation helpful? Give feedback.
-
|
@scog2006 have you solved your problem? |
Beta Was this translation helpful? Give feedback.
-
|
Yes, it is working.
…On Tue, Sep 16, 2025, 2:17 AM fdufnews ***@***.***> wrote:
@scog2006 <https://github.com/scog2006> have you solved your problem?
—
Reply to this email directly, view it on GitHub
<#18048 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXDL56ZSMIKCZKPJ65JSRDD3S62RJAVCNFSM6AAAAACF656ZQCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTINBRGE3TKNY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
It turns out the problem wasn't with Micropython but my lack of
understanding of the limitations of Python Tutor. The error I was getting
was from Python Tutor which doesn't work well with Micropython. Why Thonny
gives the option to use Python Tutor when you are working in Micropython
seems like an error in Thonny.
Thanks to all of the members who sent suggestions to help solve my problem.
…On Wed, Sep 17, 2025, 7:06 AM fdufnews ***@***.***> wrote:
Maybe you can explain how you solved the problem, it may help others.
if the solution was provided by one of the participants tag the
corresponding answer
—
Reply to this email directly, view it on GitHub
<#18048 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXDL5653W66FMFGPWTIYAQ33TFFFVAVCNFSM6AAAAACF656ZQCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTINBSG42TMMA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using micropython 1.26 on a Raspberry Pico with the Thonny IDE. When I try to run the program it stops on the first line which is" import machine". I get an error message saying machine does not exist or is not supported. I tried updating Micropython in Thonny but with the same results. Then I tried loading Micropython using the uf2 file with the same results. I have tried using both my laptop and my PC with same results. What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions