Unable to build for mbed: fails to include packages deprecated in python 3.12 (pls help)

Hi there,
I just ran into the same problem with Python 3.12 on Windows, here is another workaround to get Mbed to work with PlatformIO and Python 3.12 (+?) that might work on Linux:

  • In the file C:\Users\YOUR_NAME\.platformio\packages\framework-mbed\platformio\package_deps\py3\past\builtins\misc.py:
  • For the next distutils error:
    • Install setuptools to get the missing package : pip install setuptools.
    • The distutils standard lib has been removed as of Python 3.12: https://peps.python.org/pep-0632/

I can’t find the misc.py file on github to open a suggestion, but maybe it’s not an ideal edit …

But as @ivankravets says: Arm dropped support some time ago, MbedOS and related build tools are outdated, and it is difficult to find the right “way” to install MbedOs for each new Python version (especially using the Arm Mbed CLI tool).

1 Like