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:- Line 45, replace
from imp import reloadwithfrom importlib import reload. - For more info: https://docs.python.org/3/whatsnew/3.12.html#imp
- Line 45, replace
- For the next
distutilserror:- Install
setuptoolsto 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/
- Install
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).