Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
FilipDominec opened this issue Jun 10, 2021 · 2 comments
Closed

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

FilipDominec opened this issue Jun 10, 2021 · 2 comments
Assignees
Labels
conclusion: off topic Off topic for this repository type: imperfection Perceived defect in any part of project

Comments

@FilipDominec
Copy link

FilipDominec commented Jun 10, 2021

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

@per1234
Copy link
Contributor

per1234 commented Jun 10, 2021

Hi @FilipDominec. Thanks for your interest in this open source project.

esptool and the choice of which Python interpreter to use is purely a matter of the 3rd party ESP32 boards platform's configuration. The Arduino IDE (or more accurately, Arduino CLI) only provides the framework that runs the compilation and upload processes according to the dictates of the platform configuration of the currently selected board. So this is not anything that can be managed from the code base hosted in this repository. It would be something to be done in the ESP32 boards platform repository, which is not maintained by the Arduino organization:
https://github.com/espressif/arduino-esp32

@per1234 per1234 closed this as completed Jun 10, 2021
@per1234 per1234 added the conclusion: invalid Issue/PR not valid label Jun 10, 2021
@FilipDominec
Copy link
Author

@per1234 thanks for info, I reported it here: espressif/arduino-esp32#4717

@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@per1234 per1234 added conclusion: off topic Off topic for this repository and removed conclusion: invalid Issue/PR not valid labels Oct 25, 2021
@per1234 per1234 self-assigned this Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: off topic Off topic for this repository type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants