0

error building circuitpython on Ubuntu 20.04
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

error building circuitpython on Ubuntu 20.04

by dgrover on Thu Apr 01, 2021 5:38 pm

What I really want is fast digital i/o (on a Seeeduino Wio Terminal, ATSAMD51); the 9 usec it takes standard Circuitpython code is far too slow for my application. So it would be great to have a ptr32 kind of function out of the box. That doesn't appear to be the case (I can't find it in any documentation, though someone seemed to be working on memory access about a year ago), so I'd like to see what I can do in the Circuitpython source to enable existing Micropython code or to write my own limited functions.

I've followed the directions on https://learn.adafruit.com/building-cir ... cuitpython to set up an environment on Ubuntu 20.04LTS (upgraded from 19.04LTS--https://xkcd.com/349/), and have gotten as far as building Circuitypython. However, the two boards I've tried to make (Wio Terminal and Circuit Playground Express) have both failed during the make at the same point:

parallels@parallels-Parallels-Virtual-Platform:~/circuitpython/ports/atmel-samd$ make BOARD=circuitplayground_express V=1
GEN build-circuitplayground_express/genhdr/mpversion.h
GEN build-circuitplayground_express/genhdr/moduledefs.h
GEN autogen_usb_descriptor.intermediate
GEN build-circuitplayground_express/genhdr/qstr.split
GEN build-circuitplayground_express/genhdr/qstrdefs.collected.h
QSTR updated
GEN build-circuitplayground_express/genhdr/qstrdefs.preprocessed.h
GEN build-circuitplayground_express/genhdr/qstrdefs.enum.h
CC ../../py/mpstate.c
CC ../../py/nlr.c
CC ../../py/nlrx86.c
CC ../../py/nlrx64.c
CC ../../py/nlrthumb.c
CC ../../py/nlrxtensa.c
CC ../../py/nlrsetjmp.c
CC ../../py/malloc.c
CC ../../py/gc.c
CC ../../py/gc_long_lived.c
CC ../../py/pystack.c
GEN build-circuitplayground_express/genhdr/qstrdefs.generated.h
CC ../../py/qstr.c
CC ../../py/vstr.c
CC ../../py/mpprint.c
CC ../../py/unicode.c
CC ../../py/mpz.c
CC ../../py/reader.c
CC ../../py/lexer.c
CC ../../py/parse.c
CC ../../py/scope.c
CC ../../py/compile.c
CC ../../py/emitcommon.c
CC ../../py/emitbc.c
CC ../../py/asmbase.c
CC ../../py/asmx64.c
CC ../../py/emitnx64.c
CC ../../py/asmx86.c
CC ../../py/emitnx86.c
CC ../../py/asmthumb.c
CC ../../py/emitnthumb.c
CC ../../py/emitinlinethumb.c
CC ../../py/asmarm.c
CC ../../py/emitnarm.c
CC ../../py/asmxtensa.c
CC ../../py/emitnxtensa.c
CC ../../py/emitinlinextensa.c
CC ../../py/formatfloat.c
CC ../../py/parsenumbase.c
CC ../../py/parsenum.c
CC ../../py/emitglue.c
CC ../../py/persistentcode.c
CC ../../py/runtime.c
CC ../../py/runtime_utils.c
CC ../../py/scheduler.c
CC ../../py/nativeglue.c
CC ../../py/stackctrl.c
CC ../../py/argcheck.c
CC ../../py/warning.c
CC ../../py/map.c
CC ../../py/enum.c
CC ../../py/obj.c
CC ../../py/objarray.c
CC ../../py/objattrtuple.c
CC ../../py/objbool.c
CC ../../py/objboundmeth.c
CC ../../py/objcell.c
CC ../../py/objclosure.c
CC ../../py/objcomplex.c
CC ../../py/objdeque.c
CC ../../py/objdict.c
CC ../../py/objenumerate.c
CC ../../py/objexcept.c
CC ../../py/objfilter.c
CC ../../py/objfloat.c
CC ../../py/objfun.c
CC ../../py/objgenerator.c
CC ../../py/objgetitemiter.c
CC ../../py/objint.c
CC ../../py/objint_longlong.c
CC ../../py/objint_mpz.c
CC ../../py/objlist.c
CC ../../py/objmap.c
CC ../../py/objmodule.c
CC ../../py/objobject.c
CC ../../py/objpolyiter.c
CC ../../py/objproperty.c
CC ../../py/objnone.c
CC ../../py/objnamedtuple.c
CC ../../py/objrange.c
CC ../../py/objreversed.c
CC ../../py/objset.c
CC ../../py/objsingleton.c
CC ../../py/objslice.c
CC ../../py/objstr.c
CC ../../py/objstrunicode.c
CC ../../py/objstringio.c
CC ../../py/objtuple.c
CC ../../py/objtype.c
CC ../../py/objzip.c
CC ../../py/opmethods.c
CC ../../py/proto.c
CC ../../py/reload.c
CC ../../py/sequence.c
CC ../../py/stream.c
CC ../../py/binary.c
CC ../../py/builtinimport.c
CC ../../py/builtinevex.c
CC ../../py/builtinhelp.c
CC ../../py/modarray.c
CC ../../py/modbuiltins.c
CC ../../py/modcollections.c
CC ../../py/modgc.c
CC ../../py/modio.c
CC ../../py/modmath.c
CC ../../py/modcmath.c
CC ../../py/modmicropython.c
CC ../../py/modstruct.c
CC ../../py/modsys.c
CC ../../py/moduerrno.c
CC ../../py/modthread.c
CC ../../py/vm.c
CC ../../py/bc.c
CC ../../py/showbc.c
CC ../../py/repl.c
CC ../../py/smallint.c
CC ../../py/frozenmod.c
CC ../../py/ringbuf.c
CC ../../extmod/moductypes.c
CC ../../extmod/modujson.c
CC ../../extmod/modure.c
CC ../../extmod/moduzlib.c
CC ../../extmod/moduheapq.c
CC ../../extmod/modutimeq.c
CC ../../extmod/moduhashlib.c
CC ../../extmod/modubinascii.c
CC ../../extmod/virtpin.c
CC ../../extmod/modussl_axtls.c
CC ../../extmod/modussl_mbedtls.c
CC ../../extmod/modurandom.c
CC ../../extmod/moduselect.c
CC ../../extmod/modwebsocket.c
CC ../../extmod/modwebrepl.c
CC ../../extmod/modframebuf.c
CC ../../extmod/vfs.c
CC ../../extmod/vfs_reader.c
CC ../../extmod/vfs_posix.c
CC ../../extmod/vfs_posix_file.c
CC ../../extmod/vfs_fat.c
CC ../../extmod/vfs_fat_diskio.c
CC ../../extmod/vfs_fat_file.c
CC ../../extmod/utime_mphal.c
CC ../../extmod/uos_dupterm.c
CC ../../lib/embed/abort_.c
CC ../../lib/utils/printf.c
FREEZE ../../frozen/Adafruit_CircuitPython_CircuitPlayground ../../frozen/Adafruit_CircuitPython_HID ../../frozen/Adafruit_CircuitPython_LIS3DH ../../frozen/Adafruit_CircuitPython_NeoPixel ../../frozen/Adafruit_CircuitPython_Thermistor
Creating build-circuitplayground_express/frozen_mpy.c
CC build-circuitplayground_express/frozen_mpy.c
CC ../../main.c
CC supervisor/port.c
CC ../../supervisor/shared/autoreload.c
CC ../../supervisor/shared/background_callback.c
CC ../../supervisor/shared/board.c
CC ../../supervisor/shared/filesystem.c
CC ../../supervisor/shared/flash.c
CC ../../supervisor/shared/micropython.c
CC ../../supervisor/shared/rgb_led_status.c
CC ../../supervisor/shared/safe_mode.c
CC ../../supervisor/shared/stack.c
CC ../../supervisor/shared/status_leds.c
CC ../../supervisor/shared/tick.c
CC ../../supervisor/shared/translate.c
GEN build-circuitplayground_express/genhdr/devices.h
Traceback (most recent call last):
File "../../tools/gen_nvm_devices.py", line 23, in <module>
typer.run(main)
File "/home/parallels/.local/lib/python3.8/site-packages/typer/main.py", line 859, in run
app()
File "/home/parallels/.local/lib/python3.8/site-packages/typer/main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "/home/parallels/.local/lib/python3.8/site-packages/typer/main.py", line 239, in get_command
click_command = get_command_from_info(typer_instance.registered_commands[0])
File "/home/parallels/.local/lib/python3.8/site-packages/typer/main.py", line 425, in get_command_from_info
command = cls( # type: ignore
TypeError: __init__() got an unexpected keyword argument 'no_args_is_help'
make: *** [../../supervisor/supervisor.mk:55: build-circuitplayground_express/genhdr/devices.h] Error 1


"which arm..." gives the right results, and I did manually add ~/.local/bin to the PATH.

Also did a clean and make again, with same results.

Are there any good next steps? (Is this the right forum to ask?)

Thanks!

dgrover
 
Posts: 4
Joined: Thu Feb 27, 2020 12:55 pm

Re: error building circuitpython on Ubuntu 20.04

by tannewt on Thu Apr 01, 2021 6:02 pm

This is the first time I've seen this error. It looks like the issue is with the devices.h generation done from python. What is the output of `pip freeze`? That'll capture the versions of the python libraries needed for the generation.

tannewt
 
Posts: 2349
Joined: Thu Oct 06, 2016 8:48 pm

Re: error building circuitpython on Ubuntu 20.04

by dgrover on Thu Apr 01, 2021 7:48 pm

Here's the output from pip3 freeze:

parallels@parallels-Parallels-Virtual-Platform:~/circuitpython/ports/atmel-samd$ pip3 freeze
alabaster==0.7.12
appdirs==1.4.4
apturl==0.5.2
asn1crypto==0.24.0
astroid==2.5.2
awscli==1.19.42
Babel==2.9.0
bcrypt==3.1.7
black==20.8b1
blinker==1.4
botocore==1.20.42
Brlapi==0.7.0
cascadetoml==0.3.0
certifi==2019.11.28
chardet==3.0.4
Click==7.0
colorama==0.4.3
command-not-found==0.3
commonmark==0.9.1
cpp-coveralls==0.4.2
cryptography==2.8
cupshelpers==1.0
dbus-python==1.2.16
defer==1.0.6
distro==1.4.0
distro-info===0.23ubuntu1
docutils==0.16
duplicity==0.8.12.0
entrypoints==0.3
fasteners==0.14.1
future==0.18.2
httplib2==0.14.0
huffman==0.1.2
idna==2.8
imagesize==1.2.0
isort==5.8.0
Jinja2==2.11.3
jmespath==0.10.0
keyring==18.0.1
keyrings.alt==3.4.0
language-selector==0.1
launchpadlib==1.10.13
lazr.restfulclient==0.14.2
lazr.uri==1.0.3
lazy-object-proxy==1.6.0
lockfile==0.12.2
louis==3.12.0
macaroonbakery==1.3.1
Mako==1.1.0
MarkupSafe==1.1.0
monotonic==1.5
mypy==0.812
mypy-extensions==0.4.3
netifaces==0.10.4
oauth==1.0.1
oauthlib==3.1.0
olefile==0.46
packaging==20.9
paramiko==2.6.0
parse==1.19.0
pathspec==0.8.1
pexpect==4.6.0
Pillow==7.0.0
polib==1.1.1
protobuf==3.6.1
pyasn1==0.4.8
pycairo==1.16.2
pycrypto==2.6.1
pycups==1.9.73
Pygments==2.8.1
PyGObject==3.36.0
PyJWT==1.7.1
pymacaroons==0.13.0
PyNaCl==1.3.0
pyOpenSSL==20.0.1
pyparsing==2.4.7
pyRFC3339==1.1
python-apt==2.0.0+ubuntu0.20.4.4
python-dateutil==2.7.3
python-debian===0.1.36ubuntu1
pytz==2019.3
pyxdg==0.26
PyYAML==5.3.1
recommonmark==0.7.1
regex==2021.3.17
reportlab==3.5.34
requests==2.22.0
requests-unixsocket==0.2.0
rsa==4.7.2
s3transfer==0.3.6
SecretStorage==2.3.1
sh==1.14.1
simplejson==3.16.0
six==1.14.0
snowballstemmer==2.1.0
Sphinx==3.5.3
sphinx-autoapi==1.7.0
sphinx-rtd-theme==0.5.1
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
sphinxcontrib-svg2pdfconverter==1.1.1
system-service==0.3
systemd-python==234
tabulate==0.8.9
toml==0.10.2
tomlkit==0.7.0
typed-ast==1.4.2
typer==0.3.2
typing-extensions==3.7.4.3
ubuntu-advantage-tools==20.3
ubuntu-drivers-common==0.0.0
ufw==0.36
unattended-upgrades==0.1
Unidecode==1.2.0
urllib3==1.25.8
usb-creator==0.3.7
wadllib==1.3.3
wrapt==1.12.1
xkit==0.0.0
zope.interface==4.7.1

Thanks!

dgrover
 
Posts: 4
Joined: Thu Feb 27, 2020 12:55 pm

Re: error building circuitpython on Ubuntu 20.04

by tannewt on Fri Apr 02, 2021 12:00 pm

Aha! Your version of click is too old: https://github.com/pallets/click/issues/1259 I'm running 7.1.2.

Do `pip install --upgrade click`

tannewt
 
Posts: 2349
Joined: Thu Oct 06, 2016 8:48 pm

Re: error building circuitpython on Ubuntu 20.04

by dgrover on Fri Apr 02, 2021 12:26 pm

That did it--both the unmodified examples compiled fine. Thank you!

I'm pretty sure I followed all the steps to set up the environment to build CircuitPython, including
Code: Select all | TOGGLE FULL SIZE
# Install needed Python packages from pypi.org.
pip3 install -r requirements-dev.txt


requirements-dev.txt only lists the name of the packages, not a specific (minimum) version. Did I have a version of click from some months back that was enough to satisfy pip but not recent enough to work in this situation?

If that's the case, should the build instructions be modified to include a pip upgrade step (for everything)? It sounds like pip may have some recent changes that are not reflected in the documentation, but the language here https://pip.pypa.io/en/stable/developme ... e-options/ seems to suggest that in the absence of the "upgrade" option, pip may be satisfied with an existing installation of a package, not knowing to look for an updated version.

dgrover
 
Posts: 4
Joined: Thu Feb 27, 2020 12:55 pm

Re: error building circuitpython on Ubuntu 20.04

by tannewt on Fri Apr 02, 2021 1:10 pm

dgrover wrote:requirements-dev.txt only lists the name of the packages, not a specific (minimum) version. Did I have a version of click from some months back that was enough to satisfy pip but not recent enough to work in this situation?

If that's the case, should the build instructions be modified to include a pip upgrade step (for everything)? It sounds like pip may have some recent changes that are not reflected in the documentation, but the language here https://pip.pypa.io/en/stable/developme ... e-options/ seems to suggest that in the absence of the "upgrade" option, pip may be satisfied with an existing installation of a package, not knowing to look for an updated version.


Typer's dependency on click should cause it to be upgraded. It appears that the dependency there does have versions to it: https://github.com/tiangolo/typer/blob/ ... t.toml#L30 We don't need the version on our deps because the error is from Typer's use of click. I'm not sure why it didn't work for you. It could be a bug in pip.

tannewt
 
Posts: 2349
Joined: Thu Oct 06, 2016 8:48 pm

Re: error building circuitpython on Ubuntu 20.04

by dgrover on Fri Apr 02, 2021 2:33 pm

Excellent. Thanks.

dgrover
 
Posts: 4
Joined: Thu Feb 27, 2020 12:55 pm

Please be positive and constructive with your questions and comments.