PlatformIO Community

VSCode PlatformIO installation fails

At first, I’m aware of numerous github issues similiar to this. But they seem to be outdated (2020 as far as I’m concerned), also none of these solutions seem to work for me.
OS: Win11 21H2
VSCode: 1.70
PlatformIO: 2.5.1
When I want to install the extension, this error occurs:

Error: Traceback (most recent call last):
  File "C:\Users\Max\.platformio\.cache\tmp\get-platformio-1.1.2.py", line 69, in <module>
    main()
  File "C:\Users\Max\.platformio\.cache\tmp\get-platformio-1.1.2.py", line 61, in main
    bootstrap()
  File "C:\Users\Max\.platformio\.cache\tmp\get-platformio-1.1.2.py", line 47, in bootstrap
    pioinstaller.__main__.main()
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\pioinstaller\__main__.py", line 133, in main
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\click\core.py", line 1128, in __call__
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\click\core.py", line 1053, in main
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\click\core.py", line 1637, in invoke
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\click\core.py", line 1395, in invoke
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\click\core.py", line 754, in invoke
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\click\decorators.py", line 26, in new_func
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\pioinstaller\__main__.py", line 61, in cli
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\pioinstaller\core.py", line 88, in install_platformio_core
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\pioinstaller\core.py", line 70, in install_platformio_core
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\pioinstaller\core.py", line 98, in _install_platformio_core
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\pioinstaller\penv.py", line 71, in create_core_penv
  File "C:\Users\Max\.platformio\.cache\tmp\.piocore-installer-01z5dm8y\tmpjafvn6w6\pioinstaller.zip\pioinstaller\penv.py", line 141, in init_state
  File "C:\Users\Max\.platformio\python3\lib\subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\Max\.platformio\python3\lib\subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\Users\\Max\\.platformio\\penv\\Scripts\\python.exe', '-c', "import sys; version=sys.version_info; print('%d.%d.%d'%(version[0],version[1],version[2]))"]' returned non-zero exit status 101.
 -> Installer version: 1.1.2
Platform: Windows-10
Python version: 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)]
Python path: C:\Users\Max\.platformio\python3\python.exe
Creating a virtual environment at C:\Users\Max\.platformio\penv

	at c:\Users\Max\.vscode\extensions\platformio.platformio-ide-2.5.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:5308
	at ChildProcess.o (c:\Users\Max\.vscode\extensions\platformio.platformio-ide-2.5.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:4691)
	at ChildProcess.emit (node:events:390:28)
	at ChildProcess.emit (node:domain:475:12)
	at maybeClose (node:internal/child_process:1064:16)
	at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

How can I fix this?

When you open a commandline (Windows + R → cmd.exe) and manually execute

C:\Users\Max\.platformio\penv\Scripts\python.exe -c "import sys; version=sys.version_info; print('%d.%d.%d'%(version[0],version[1],version[2]))"

what’s the output?