Unable to debug - libpython2.7.so.1.0 missing under Ubuntu 24.04 LTS

Am encountering the following error when attempting to debug an AZ_delivery board using an ESP-prog board with a clean install of both MS Code and PlatformIO. Previously, this setup has worked flawlessly but I haven’t done any ESP32 debugging for a while so I can’t confirm the previous libraries used etc.

The main.cpp code compiles fine but the PIO debug fails to start debugging. On switching to the debug console, the following error is present (username obfuscated for security):

undefined/home/----/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gdb: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

This behaviour is exhibited with both the DEB release of MS Code and the Flatpak. Ubuntu is currently on Python 3.x and does not support the installation of earlier Python libraries globally.

I am using the following platformio.ini settings:

platform = espressif32
board = az-delivery-devkit-v4
framework = arduino
monitor_speed = 115200
debug_tool = esp-prog
upload_protocol = esp-prog
debug_init_break = tbreak setup
debug_speed = 1000
build_type = debug
debug_build_flags = -O0 -g -ggdb

Is this error message just a red-herring or is my platformio.ini file incorrect?

I think no red herring and your platformio.ini looks fine for me and IMHO can’t be the origin of the error - it comes from your OS.

Using file and ldd on my system (an openSUSE Leap) shows me that

file ~/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gdb
~/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gdb: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), **dynamically linked**, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=a5169bbb9fb2bae5c9fe959aa6b3f81a53485573, stripped


ldd ~/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gdb
        linux-vdso.so.1 (0x00007ffef559b000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f4a4b86b000)
        libpython2.7.so.1.0 => /usr/lib64/libpython2.7.so.1.0 (0x00007f4a4b620000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4a4b5fc000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00007f4a4b5f8000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f4a4b4ac000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f4a4b265000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f4a4b241000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f4a4b04a000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4a4b8b2000)

AFAIR I installed the needed lib manually (years ago :wink:)

May be you can follow the instructions described in this post on ubuntuforums to solve your problem

There is an open, unresolved issue on https://github.com/platformio/platform-espressif32/

Thank you both. Unfortunately, until this bug is patched I have had to resort to running MS Code + Platformio in a VM, currently with an earlier version of Ubuntu 22.04. Not ideal as 22.04 still has a few months to go until end of life, fingers crossed they won’t take them out the repository before the bug is squashed!