Ubuntu error loading python lib when compiling esp32

Hello
I am new to esp32 and I am trying to use arduino IDE. I tryed both 1.8.19 and 2.3.2 IDE version and got the same error.
When I try to compile (verify) any example sketch I get this error message:

[5193] Error loading Python lib '/tmp/_MEIaEqtS1/libpython3.8.so.1.0': dlopen: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/_MEIaEqtS1/libpython3.8.so.1.0)
exit status 255

I checked and both mentioned files (libpython3.8.so.1.0 and libm.so.6) are there. By the way I tryed on 2 machines, one running ubuntu 16.04 and other ubuntu 22.04. Both machines have these files present but show the same error message.
The only difference is GLIBC version. Ubuntu 16.04 is older version 2.23 and ubuntu 22-05 is newer version 2.35. The required version on error message is 2.29 - ok to assume it can not work on the older ubuntu, but why not on newer? Does the IDE demands the exact GLIBC version to work?

So I am stuck at this point. Searching for days, but can not find any explanation or solution for why IDE does not recognize the existing files.

Does anybody can help me here?

1 Like

I have the exact same issue and had high hopes when this came up in my search. ...but bummer, no one has figured it out yet.....

Looking at the message again, with some additional word-wrap

Error loading Python lib '/tmp/_MEIaEqtS1/libpython3.8.so.1.0': 
                  dlopen: /lib/x86_64-linux-gnu/libm.so.6:
version `GLIBC_2.29' not found 
             (required by /tmp/_MEIaEqtS1/libpython3.8.so.1.0)

No surprise both files are there; you wouldn't get the error otherwise

  • trying to load libpython
    • requires libm, which is the basic math library, m
      • which requires GLIBC_2.29

You said your Ubuntu 22.04 has GLIBC 2.29, maybe checked with

$ ldd --version
ldd (Ubuntu GLIBC 2.39-0ubuntu8.3) 2.39

(I have 2.39 with 22.04) You can verify the requirements for libm with

$ objdump -T /lib/x86_64-linux-gnu/libm.so.6 | grep -E '\.text.+GLIBC' | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -V | uniq -c
    312 2.2.5
     81 2.15
      3 2.18
      3 2.23
      6 2.24
     50 2.25
    136 2.26
    421 2.27
     52 2.28
      5 2.29
     16 2.31
      1 2.32
     92 2.35
      2 2.38
      1 2.39

(My libm is actually in /usr/lib) This says that it has 312 dependencies on GLIBC 2.2.5, and one for the latest/current 2.39.

Is Python installed correctly on your system? Run python3 in another window, then run

$ lsof -p `pgrep python3`
COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
python3 5519 kenb4  cwd    DIR  259,2     4096 9961473 /home/kenb4
python3 5519 kenb4  rtd    DIR  259,3     4096       2 /
python3 5519 kenb4  txt    REG  259,3  8023232 5902618 /usr/bin/python3.12
python3 5519 kenb4  mem    REG  259,3  5719296 5903151 /usr/lib/locale/locale-archive
python3 5519 kenb4  mem    REG  259,3   344096 5924555 /usr/lib/x86_64-linux-gnu/libreadline.so.8.2
python3 5519 kenb4  mem    REG  259,3  2125328 5910255 /usr/lib/x86_64-linux-gnu/libc.so.6
python3 5519 kenb4  mem    REG  259,3   208328 5898314 /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4
python3 5519 kenb4  mem    REG  259,3   170240 5903277 /usr/lib/x86_64-linux-gnu/libexpat.so.1.9.1
python3 5519 kenb4  mem    REG  259,3   113000 5905701 /usr/lib/x86_64-linux-gnu/libz.so.1.3
python3 5519 kenb4  mem    REG  259,3   952616 5910258 /usr/lib/x86_64-linux-gnu/libm.so.6
python3 5519 kenb4  mem    REG  259,3    40640 8258224 /usr/lib/python3.12/lib-dynload/readline.cpython-312-x86_64-linux-gnu.so
python3 5519 kenb4  mem    REG  259,3    27028 5910245 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
python3 5519 kenb4  mem    REG  259,3   236616 5910252 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
python3 5519 kenb4    0u   CHR  136,1      0t0       4 /dev/pts/1
python3 5519 kenb4    1u   CHR  136,1      0t0       4 /dev/pts/1
python3 5519 kenb4    2u   CHR  136,1      0t0       4 /dev/pts/1

You can see the libm is listed, so the GLIBC dependency is fulfilled.

What's suspicious is that your failing libpython is in /tmp: /tmp/_MEIaEqtS1/libpython3.8.so.1.0. That hints that it's using an alternate file system root of some kind. And there, the GLIBC is too old. What else is in /tmp/_MEIaEqtS1?

The "fix" is to downrev the ESP32 library, 3.0.7 does not have this error

2 Likes

Thanks, PhxTed. I had the same issue recently, and your suggestion was the only thing that worked.

Same issue here on a fresh install of Ubuntu 24.04 and snap package of arduino IDE 1.8.19. Everything works with the ESP32 library downgraded to 3.0.7.

I suspect the problem is that the version of the glibc shared library that is installed in the sandbox environment in which the Snap package runs is too old. This is separate from the version installed in the general Linux environment.

The solution I recommend is to uninstall the 3rd party Snap package and then install the official build of Arduino IDE the Arduino company distributes. This will allow you to use the latest version of the "esp32" boards platform.

You can download it from the "Software" page here:

https://www.arduino.cc/en/software/

I recommend using the latest version of Arduino IDE, but if you have some specific reason for wanting to continue to use the obsolete Arduino IDE 1.8.19, it is also available for download there:

https://www.arduino.cc/en/software/#legacy-ide-18x


If you do want to manage Arduino IDE via a package manager, you might consider using the Flatpak package instead of the Snap. I believe you will be able to use the latest version of the "esp32" boards platform with that package.

There is a Flatpak package of Arduino IDE 2.x:

Like the Snap package, this is maintained by a 3rd party, without any involvement from the Arduino company. However, it is quite well maintained.

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