ESP32 Compile error library not found?

I'm using Arduino Ide 1.8.19 on a Ubuntu 22.04 pc trying ESP32 for the first time..

The board is printed esp32wroom32u
I select ESP32 Dev Module as no Wroom work better.

I tried compile an example and the following errors occur... please help.
Probably proper library not loaded but I d'nt know where to look for !

Thanks a lot

Serge

========================================================

Arduino:1.8.19 (Linux), Carte : "ESP32 Dev Module, Disabled, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, None, Disabled"

ATTENTION : La catégorie '' dans la bibliothèque ESP Insights n'est pas valide. Définition sur : 'Uncategorized'
ATTENTION : La catégorie '' dans la bibliothèque ESP RainMaker n'est pas valide. Définition sur : 'Uncategorized'
ATTENTION : La catégorie '' dans la bibliothèque WiFiProv n'est pas valide. Définition sur : 'Uncategorized'
Traceback (most recent call last):
  File "/home/grelot/.arduino15/packages/esp32/tools/esptool_py/4.5/esptool.py", line 31, in <module>
    import esptool
  File "/home/grelot/.arduino15/packages/esp32/tools/esptool_py/4.5/esptool/__init__.py", line 41, in <module>
    from esptool.cmds import (
  File "/home/grelot/.arduino15/packages/esp32/tools/esptool_py/4.5/esptool/cmds.py", line 14, in <module>
    from .bin_image import ELFFile, ImageSegment, LoadFirmwareImage
  File "/home/grelot/.arduino15/packages/esp32/tools/esptool_py/4.5/esptool/bin_image.py", line 14, in <module>
    from .loader import ESPLoader
  File "/home/grelot/.arduino15/packages/esp32/tools/esptool_py/4.5/esptool/loader.py", line 30, in <module>
    import serial
ModuleNotFoundError: No module named 'serial'
exit status 1
Erreur de compilation pour la carte ESP32 Dev Module
=======================================================

Hi @dubser123.

The Linux version of the ESP32 boards platform uses a Python script named esptool when compiling sketches. That esptool script has a dependency on the pyserial Python package. The "No module named 'serial'" error occurs because that package dependency is not installed on your computer.

We are accustomed to all the dependencies of Arduino boards platforms being automatically installed along with the platform by the Arduino "Boards Manager", but the ESP32 platform developers didn't make their project that way. You are expected to manually install this pyserial Python package if you don't have it installed already. So the solution to the error is to use pip to install the pyserial package.

Try this:

  1. Open a command line terminal on your computer.
  2. Type the following command:
    python3 -m pip install pyserial
    
  3. Press the Enter key.

If we are lucky, terminal output will now show the pyserial package being installed successfully.

Now try compiling your sketch again. Hopefully the "No module named 'serial'" error will no longer occur.

1 Like

Thanks a lot it solve the problem, IT is running ok now.

You are welcome. I'm glad it is working now.

Regards,
Per

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