Skip to content

esptool.py should be ran by python3, not python2 #410

Closed
@FilipDominec

Description

@FilipDominec

Describe the bug
On newer Ubuntu (Focal Fossa), it is not easy to install the pyserial module anymore for python2. The repository has pyserial for python3 only. Therefore, this dependency of esptool.py for python2 is missing on most systems.

Desktop (please complete the following information):

  • OS: Ubuntu
  • Version: Focal Fossa, 20.04

Quick & dirty fix
Actually, esptool.py seems to run with Python3.

Since the upload command may be hard-coded in Arduino IDE, a small change can be made to switch the python interpreter:

  1. go to .arduino15/packages/esp32/tools/ and rename esptool.py to real_esptool.py

  2. in the same directory, create a file esptool.py with the following contents:

    import subprocess, sys
    subprocess.call("python3 ./real_esptool.py " + " ".join(sys.argv[1:]), shell=True)

  3. run the arduino studio like before; it should be able to upload now

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions