Page 1 of 1

Arduino build fails under Ubuntu 20.04

Posted: Sat May 16, 2020 7:47 am
by CollieJim
I have just installed Ubuntu 20.04, and learned to my dismay that Python2 is only marginally supported.

pySerial is not included, nor do I see any way to install it. It's not in the repo, and pip2 is not available either.

The boards manager URL I use is
https://dl.espressif.com/dl/package_esp32_index.json

Code: Select all

ESP $ arduino-cli compile --fqbn esp32:esp32:esp32doit-devkit-v1  ESP32_ILI9341
Traceback (most recent call last):
  File "/home/cave/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py", line 37, in <module>
    import serial
ImportError: No module named serial
Is there a version of the boards that use Python3?
Thanks

Re: Arduino build fails under Ubuntu 20.04

Posted: Sun May 17, 2020 4:48 pm
by lbernstone
Your system is still running python2. I would suggest you move forward. Use update-alternatives to set your default to python3, and then use pip3 to install any missing dependencies.

Code: Select all

sudo update-alternatives --config python3

Re: Arduino build fails under Ubuntu 20.04

Posted: Mon May 18, 2020 1:38 am
by CollieJim
As can be seen in the original post, the toolchain used uses Python2. pip3 is not going to get pySerial for python2.
The way forward, ideally, is for the toolchain to be upgraded to Python3.

Re: Arduino build fails under Ubuntu 20.04

Posted: Wed May 20, 2020 3:04 am
by lbernstone
esptool != toolchain. It is a utility used to upload the data to the device.
It is using your default python, which is currently python2. Use update-alternatives to modify that. You can then test by running `python ~/.arduino15/packages/esp32/hardware/esp32/1.0.4/tools/esptool.py`

Re: Arduino build fails under Ubuntu 20.04

Posted: Wed May 20, 2020 12:52 pm
by CollieJim
I realised after pressing submit that toolchain was the wrong word.
Anyway, thanks for your help. All is well now.
I think I know what I'm doing, but that's clearly an illusion...

Re: Arduino build fails under Ubuntu 20.04

Posted: Thu May 21, 2020 1:40 am
by lbernstone