Compile error: ModuleNotFoundError: No module named 'serial' [SOLVED]

Admittedly it has been several months since I was regularly using the Arduino IDE; which is currently version 1.8.19.The only change in the interim was I recently upgraded to a new Linux Ubuntu: 22.04.1 LTS . My issue is when I compile my ESP32 sketch I receive a "module not found" error. This same sketch was compiling error free a few months back. I also tried the terminal command:

sudo apt install python-is-python3

That was suggested for a similar error when running the IDE on a Raspberry PI platform. That fixed the issue on that platform.
Which ESP32 files, if any, under Manage Libraries should be installed on the IDE?

Under the IDE Preferences/ additional libraries is:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

Sketch includes:

    #include <SPI.h>
    #include <WiFi.h>
    #include <math.h>

Compile Error message output:

WARNING: library StackString claims to run on avr architecture(s) and may be incompatible with your current board which runs on esp32 architecture(s).
Traceback (most recent call last):
  File "/home/ed/Arduino/hardware/espressif/esp32/tools/esptool/esptool.py", line 38, in <module>
    import serial
ModuleNotFoundError: No module named 'serial'
Multiple libraries were found for "WiFi.h"
 Used: /home/ed/Arduino/hardware/espressif/esp32/libraries/WiFi
 Not used: /home/ed/Arduino Installation Point/arduino-1.8.19/libraries/WiFi
 Not used: /home/ed/Arduino/libraries/WiFiNINA
exit status 1
Error compiling for board ESP32 Dev Module.

thanks fellas.

1 Like

Try

sudo apt install python3-serial
4 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.