Running pio run results in an ImportError when running Python 3.10.
Processing motor (board: uva_solar_car; platform: ststm32 @ ^11.0.0; framework: mbed)
---------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/uva_solar_car.html
PLATFORM: ST STM32 (11.0.0) > STM32 G473CET6
HARDWARE: STM32G473CET6 48MHz, 128KB RAM, 512KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, jlink)
PACKAGES:
- framework-mbed 6.60900.210318 (6.9.0)
- toolchain-gccarmnoneeabi 1.90201.191206 (9.2.1)
ImportError: cannot import name 'Iterable' from 'collections' (/usr/lib64/python3.10/collections/__init__.py):
File "/var/home/edward/.local/lib/python3.10/site-packages/platformio/builder/main.py", line 181:
env.SConscript("$BUILD_SCRIPT")
File "/var/home/edward/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/var/home/edward/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/var/home/edward/.platformio/platforms/ststm32/builder/main.py", line 99:
target_elf = env.BuildProgram()
File "/var/home/edward/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Util.py", line 742:
return self.method(*nargs, **kwargs)
File "/var/home/edward/.local/lib/python3.10/site-packages/platformio/builder/tools/platformio.py", line 61:
env.ProcessProgramDeps()
File "/var/home/edward/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Util.py", line 742:
return self.method(*nargs, **kwargs)
File "/var/home/edward/.local/lib/python3.10/site-packages/platformio/builder/tools/platformio.py", line 128:
env.BuildFrameworks(env.get("PIOFRAMEWORK"))
File "/var/home/edward/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Util.py", line 742:
return self.method(*nargs, **kwargs)
File "/var/home/edward/.local/lib/python3.10/site-packages/platformio/builder/tools/platformio.py", line 343:
SConscript(env.GetFrameworkScript(f), exports="env")
File "/var/home/edward/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 660:
return method(*args, **kw)
File "/var/home/edward/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/var/home/edward/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/var/home/edward/.platformio/platforms/ststm32/builder/frameworks/mbed.py", line 35:
SConscript(
File "/var/home/edward/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 660:
return method(*args, **kw)
File "/var/home/edward/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/var/home/edward/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/var/home/edward/.platformio/packages/framework-mbed/platformio/platformio-build.py", line 44:
from pio_mbed_adapter import PlatformioMbedAdapter
File "/var/home/edward/.platformio/packages/framework-mbed/platformio/pio_mbed_adapter.py", line 23:
from tools.build_api import prepare_toolchain, UPDATE_WHITELIST
File "/var/home/edward/.platformio/packages/framework-mbed/tools/build_api.py", line 48:
from .libraries import Library
File "/var/home/edward/.platformio/packages/framework-mbed/tools/libraries.py", line 25:
from tools.tests import TEST_MBED_LIB, DEFAULT_SUPPORT
File "/var/home/edward/.platformio/packages/framework-mbed/tools/tests.py", line 18:
from past.builtins import cmp
File "/var/home/edward/.platformio/packages/framework-mbed/platformio/package_deps/py3/past/builtins/__init__.py", line 43:
from past.builtins.noniterators import (filter, map, range, reduce, zip)
File "/var/home/edward/.platformio/packages/framework-mbed/platformio/package_deps/py3/past/builtins/noniterators.py", line 24:
from past.types import basestring
File "/var/home/edward/.platformio/packages/framework-mbed/platformio/package_deps/py3/past/types/__init__.py", line 25:
from .oldstr import oldstr
File "/var/home/edward/.platformio/packages/framework-mbed/platformio/package_deps/py3/past/types/oldstr.py", line 5:
from collections import Iterable
From looking into the stack trace, it looks like this is caused by the future package. I think updating future from 0.17.1 to 0.18.0 or later should fix the issue.
Running
pio run
results in anImportError
when running Python 3.10.From looking into the stack trace, it looks like this is caused by the
future
package. I think updatingfuture
from0.17.1
to0.18.0
or later should fix the issue.