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

itsyonas
Posts: 1
Joined: Tue Sep 15, 2020 3:25 pm

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

Postby itsyonas » Tue Sep 15, 2020 3:30 pm

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.

mrburnette
Posts: 22
Joined: Mon Feb 12, 2018 6:50 pm

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

Postby mrburnette » Sun Sep 20, 2020 10:15 pm

If you use Arduino, you will overwrite Python and will have to use the Espressif flash tool to reload the Python binary interpreter.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 78 guests