platform-ststm32 icon indicating copy to clipboard operation
platform-ststm32 copied to clipboard

Could not initialize project, Python 3.10+

Open imsakg opened this issue 2 years ago • 5 comments

With Python3.10, they move Iterable object under Collections.abc So im getting error when i initialize project. Is will be fix for it or am i need to use Python3.9 ?

https://pastebin.com/raw/GiQ968XN

imsakg avatar Mar 21 '22 01:03 imsakg

same problem

zayats1 avatar Mar 29 '22 12:03 zayats1

@zayats1 Hey, i fixed my problem with using platformio core. I also patch some package files because im using Python3.10+. Changes: ~ /home/$USER/.platformio/packages/framework-mbed/platformio/package_deps/py3/past/types/oldstr.py Line 5 :

  • from collections import Iterable > from collections.abc import Iterable

~ /home/$USER/.platformio/packages/framework-mbed/platformio/package_deps/py3/past/builtins/misc.py Line 4:

  • from collections import Mapping > from collections.abc import Mapping

imsakg avatar Apr 03 '22 00:04 imsakg

@imsakg Thank you! It works.

zayats1 avatar Apr 07 '22 15:04 zayats1

I have encountered this issue as well and the easy fix provided by @imsakg worked fine. I suppose the python3 dependencies list should be updated to include the most recent python-future package version (which contains the past package as well), as shown for example here and here?

matteomeneghetti avatar Jul 05 '22 13:07 matteomeneghetti

Python 3.10 has been out for almost a year now, it's probably worth trying to get these fixes into the main release. Is this the right repository for a fix?

mattj23 avatar Sep 09 '22 04:09 mattj23

@zayats1 Hey, i fixed my problem with using platformio core. I also patch some package files because im using Python3.10+. Changes: ~ /home/$USER/.platformio/packages/framework-mbed/platformio/package_deps/py3/past/types/oldstr.py Line 5 :

* from collections import Iterable >  from collections.abc import Iterable

~ /home/$USER/.platformio/packages/framework-mbed/platformio/package_deps/py3/past/builtins/misc.py Line 4:

* from collections import Mapping > from collections.abc import Mapping

After these steps is it necessary any other configuration? I edited the files, however the problem persists

qleonardolp avatar Mar 07 '23 20:03 qleonardolp

@zayats1 Hey, i fixed my problem with using platformio core. I also patch some package files because im using Python3.10+. Changes: ~ /home/$USER/.platformio/packages/framework-mbed/platformio/package_deps/py3/past/types/oldstr.py Line 5 :

* from collections import Iterable >  from collections.abc import Iterable

~ /home/$USER/.platformio/packages/framework-mbed/platformio/package_deps/py3/past/builtins/misc.py Line 4:

* from collections import Mapping > from collections.abc import Mapping

After these steps is it necessary any other configuration? I edited the files, however the problem persists

Hey, you can trace your stderr message and find the problem. It was enough to edit that file before but idk now.

imsakg avatar Mar 07 '23 21:03 imsakg