Page 1 of 1

"Cannot import serial" in Arduino IDE but running the script with python works

Posted: Tue Sep 15, 2020 3:30 pm
by itsyonas
Hello,
I have been trying to get a sample sketch in the Arduino IDE to compile but I always get:

Code: Select all

Traceback (most recent call last):
  File "/home/yonas/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py", line 37, in <module>
    import pyserial
ModuleNotFoundError: No module named 'pyserial'
Multiple libraries were found for "WiFi.h"
 Used: /home/yonas/.arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi
 Not used: /app/Arduino/libraries/WiFi
exit status 1
Error compiling for board AI Thinker ESP32-CAM.
But if I just run it from my console like "python esptool.py" I don't get any errors, and it just shows me the help page, and I have tested that with all installed python versions, so I have no clue anymore what is going on, or how to resolve this issue.

Thank you for any help.

Re: "Cannot import serial" in Arduino IDE but running the script with python works

Posted: Sun Sep 20, 2020 10:15 pm
by mrburnette
If you use Arduino, you will overwrite Python and will have to use the Espressif flash tool to reload the Python binary interpreter.