danjperron
Posts: 4504
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Version 1.14 missing module array (fixed! Don't update with Thonny!)

Mon Feb 08, 2021 4:56 pm

I just try the example

https://github.com/raspberrypi/pico- ... pio_irq.py

it complains about no module array.

But micropython version 1.13 is fine!

I tried to figure out which packages I need to run the pio_irq.py on version 1.14 ?

What is the correct packages?
Last edited by danjperron on Mon Feb 08, 2021 6:28 pm, edited 1 time in total.

astrorafael
Posts: 6
Joined: Thu Jan 28, 2021 1:37 pm

Re: Version 1.14 missing module array

Mon Feb 08, 2021 6:05 pm

I have just built micropython from the offical Micropython GitHub repo, following the instructions and it is there ...

Code: Select all

MicroPython v1.14-9-g9dedcf122 on 2021-02-07; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> import array
>>> 

DirkS
Posts: 10956
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Version 1.14 missing module array

Mon Feb 08, 2021 6:16 pm

You need the version from 5/2 or later from https://micropython.org/download/rp2-pico/ (that's 1.14-8 or later)
'array' is missing from older ones.

danjperron
Posts: 4504
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Version 1.14 missing module array (fixed ! don't update with Thonny)

Mon Feb 08, 2021 6:26 pm

Ok problem fixed!


If you let Thonny updating your Pico then you don't have the up to date one!

I just reflashed the firmware from

https://www.raspberrypi.org/documentati ... 00cac3.uf2

and it is working!

Then don't use Thonny to update the firmware!

danjperron
Posts: 4504
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Version 1.14 missing module array (fixed! Don't update with Thonny!)

Mon Feb 08, 2021 6:44 pm

You need the version from 5/2 or later from https://micropython.org/download/rp2-pico/ (that's 1.14-8 or later)
'array' is missing from older ones.
From the Thonny update firmware using a raspberry Pi I got
>>> import array
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'array'
>>> import os
>>> os.uname()
(sysname='rp2', nodename='rp2', release='1.14.0', version='v1.14 on 2021-02-02 (GNU 9.3.0 MinSizeRel)', machine='Raspberry Pi Pico with RP2040')
And from the latest version from the raspberry pi site I got
>>> import array
>>> import os
>>> os.uname()
(sysname='rp2', nodename='rp2', release='1.14.0', version='v1.14 on 2021-02-05 (GNU 9.3.0 MinSizeRel)', machine='Raspberry Pi Pico with RP2040')
Then the question,
Why is the -8 not included in the os.uname() because both of them are V1.14.0. The date indicates only the compiling date!

DirkS
Posts: 10956
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Version 1.14 missing module array (fixed! Don't update with Thonny!)

Mon Feb 08, 2021 6:50 pm

There's a difference between the dot and the dash version #s.
All the 1.14 releases versions are still at .0.

AFAIK the dash version IDs are build numbers of the nightly builds. No idea why these are not included in the internal ID.
Maybe ask the devs on github ?

User avatar
jbeale
Posts: 4003
Joined: Tue Nov 22, 2011 11:51 pm

Re: Version 1.14 missing module array (fixed! Don't update with Thonny!)

Sat Mar 06, 2021 5:15 am

Arghh, I just ran into this after updating the Pico with Thonny. I'm not clear on how to fix this. Where can I find the correct update and how do I install it?

Code: Select all

MicroPython v1.14 on 2021-02-02; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
  File "<stdin>", line 16, in <module>
  File "rp2.py", line 228, in asm_pio
  File "rp2.py", line 36, in __init__
ImportError: no module named 'array'
UPDATE: ok, I tried the latest from https://micropython.org/download/rp2-pico/
which was: rp2-pico-20210306-unstable-v1.14-83-g680ce4532.uf2 which seems to fix it.

Code: Select all

MicroPython v1.14 on 2021-03-06; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> %Run -c $EDITOR_CONTENT
>>> 

hippy
Posts: 15198
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Version 1.14 missing module array (fixed! Don't update with Thonny!)

Sat Mar 06, 2021 3:51 pm

jbeale wrote:
Sat Mar 06, 2021 5:15 am
UPDATE: ok, I tried the latest from https://micropython.org/download/rp2-pico/
which was: rp2-pico-20210306-unstable-v1.14-83-g680ce4532.uf2 which seems to fix it.
That's what my own builds are using as a baseline ...

Code: Select all

MicroPython v1.14-83-g680ce4532-dirty on 2021-03-06; RP2HACK with RP2040
Type "help()" for more information.
>>> import os
>>> os.uname()
(sysname='rp2', nodename='rp2', release='1.14.0', version='v1.14-83-g680ce4532-dirty on 2021-03-06 (GNU 7.3.1 MinSizeRel)', machine='RP2HACK with RP2040')
Why release is ".0", when version is "-83", is a bit odd, but at least "-83" is shown in the banner message for me.

The code which prints that is below, and it is similar elsewhere when the banner is emitted -

~/pico/micropython/lib/utils/pyexec.c

Code: Select all

mp_hal_stdout_tx_str("MicroPython " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; " MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME "\r\n");
And that "MICROPY_GIT_TAG" appears to be determined and set by '~/pico/micropython/py/makeversionhdr.py' which I guess is part of the 'genhdr' phase of the build. It does seem the "-NN" and the rest only appear for dirty builds and what it thinks is going on, where it's run from, whether it finds a 'git hash' or not ....

Code: Select all

pi@Pi3B:~/pico/micropython $ python3 ~/pico/micropython/py/makeversionhdr.py xyzzy
GEN xyzzy
pi@Pi3B:~/pico/micropython $ cat xyzzy
// This file was generated by py/makeversionhdr.py
#define MICROPY_GIT_TAG "v1.14-83-g680ce4532-dirty"
#define MICROPY_GIT_HASH "680ce4532-dirty"
#define MICROPY_BUILD_DATE "2021-03-06"
And, digging deeper, that seems to use whatever 'git' tells it to use, so perhaps not a MicroPython issue at all.

User avatar
aivarannamaa
Posts: 64
Joined: Wed Dec 12, 2012 1:58 pm
Location: Estonia

Re: Version 1.14 missing module array (fixed! Don't update with Thonny!)

Wed Mar 10, 2021 3:06 pm

FYI, Thonny's Pico firmware updater now uses 20210205 variant, so you can use Thonny's updater again. No need to upgrade Thonny for this (It always takes the download url from https://raw.githubusercontent.com/thonn ... mware.json)
Aivar
https://thonny.org

hippy
Posts: 15198
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Version 1.14 missing module array (fixed! Don't update with Thonny!)

Wed Mar 10, 2021 5:02 pm

aivarannamaa wrote:
Wed Mar 10, 2021 3:06 pm
FYI, Thonny's Pico firmware updater now uses 20210205 variant, so you can use Thonny's updater again. No need to upgrade Thonny for this (It always takes the download url from https://raw.githubusercontent.com/thonn ... mware.json)

Code: Select all

{
  "tag_name": "v1.14-0205",
  "name": "20210205 v1.14",
  "published_at": "2021-02-05T00:00:00Z",
  "assets": [
    {
      "name": "rp2-pico-micropython-20210205-v1.14.uf2",
      "label": null,
      "size": 497664,
      "browser_download_url": "https://www.raspberrypi.org/documentation/rp2040/getting-started/static/f70cc2e37832cde5a107f6f2af06b4bc/rp2-pico-20210205-unstable-v1.14-8-g1f800cac3.uf2"
    }
  ]
}
That's a whole lot of differing naming conventions there. Thonny offers up "v1.14-0205 (2021-02-05)" which is a little confusing because "v1.14-0205" is similar to MicropPython's own naming convention, but that doesn't exist, so it's not exactly clear from that what is being delivered, what someone may have actually installed.

Could it not simply say "rp2-pico-20210205-unstable-v1.14-8-g1f800cac3.uf2" or whatever it is downloading and be done with it ?

Return to “MicroPython”