Unable to start Platformio in VSCode. Problem has existed for months

%23 Description of problem
Unable to start Platformio, i get a screen that says: Loading... and it is stuck.
This error message appears, the details are below. It seems to me like my ~/.platformio/penv/bin
folder keeps getting deleted whenever I start vscode… not sure how, I tried restoringit with:

python3 -m venv /home/kevin/.platformio/penv
source /home/kevin/.platformio/penv/bin/activate
pip install platformio
But no luck
%23 Configuration

VSCode: 1.79.2
PIO IDE: v3.2.0
System: Linux, 5.15.0-73-generic, x64

%23 Exception

Error: Traceback (most recent call last):
File "/home/kevin/.platformio/.cache/tmp/get-platformio-1.1.3.py", line 69, in <module>
  main()
File "/home/kevin/.platformio/.cache/tmp/get-platformio-1.1.3.py", line 61, in main
  bootstrap()
File "/home/kevin/.platformio/.cache/tmp/get-platformio-1.1.3.py", line 47, in bootstrap
  pioinstaller.__main__.main()
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/pioinstaller/__main__.py", line 133, in main
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/click/core.py", line 1128, in __call__
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/click/core.py", line 1053, in main
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/click/core.py", line 1637, in invoke
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/click/core.py", line 1395, in invoke
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/click/core.py", line 754, in invoke
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/click/decorators.py", line 26, in new_func
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/pioinstaller/__main__.py", line 61, in cli
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/pioinstaller/core.py", line 70, in install_platformio_core
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/pioinstaller/core.py", line 98, in _install_platformio_core
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/pioinstaller/penv.py", line 71, in create_core_penv
File "/home/kevin/.platformio/.cache/tmp/.piocore-installer-or_2uj5j/tmp3vohxh9j/pioinstaller.zip/pioinstaller/penv.py", line 141, in init_state
File "/usr/lib/python3.11/subprocess.py", line 466, in check_output
  return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 548, in run
  with Popen(*popenargs, **kwargs) as process:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
  self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
  raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/kevin/.platformio/penv/bin/python'
-> Installer version: 1.1.3
Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.36
Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/kevin/.platformio/penv

  at /home/kevin/.vscode/extensions/platformio.platformio-ide-3.2.0-linux-x64/node_modules/platformio-node-helpers/dist/index.js:1:5300
  at ChildProcess.o (/home/kevin/.vscode/extensions/platformio.platformio-ide-3.2.0-linux-x64/node_modules/platformio-node-helpers/dist/index.js:1:4598)
  at ChildProcess.emit (node:events:513:28)
  at ChildProcess.emit (node:domain:489:12)
  at maybeClose (node:internal/child_process:1121:16)
  at Socket.<anonymous> (node:internal/child_process:479:11)
  at Socket.emit (node:events:513:28)
  at Socket.emit (node:domain:489:12)
  at Pipe.<anonymous> (node:net:757:14)

Could you remove /home/kevin/.platformio/penv folder and restart VSCode? Also please don’t forget about

apt-get install python3-venv python3-distutils

Hello Ivankravets,
Thanks for your response but sadly, that didn’t do it :frowning:
I double checked that both python3-venv and python3-distutils is installed, and I attempted to delete both /home/kevin/.platformio/penv, and restart vs code, when that failed, I deleted all of the .platformio directory, but that didn’t work as well.
I REALLY would like to use platformio for my upcoming project, but this is sortof a show stopper for it.

Could you try an installer sciprt? Close the VSCode, open the system terminal, and run it. Do you see any errors?

Here is the full output from the installer script:

kevin@kevin-CF-33S-1:~$ wget https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -O get-platformio.py
python3 get-platformio.py
--2023-07-04 10:50:28--  https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.111.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 929530 (908K) [text/plain]
Saving to: ‘get-platformio.py’

get-platformio.py   100%[===================>] 907.74K  1.13MB/s    in 0.8s    

2023-07-04 10:50:29 (1.13 MB/s) - ‘get-platformio.py’ saved [929530/929530]

Installer version: 1.1.3
Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.36
Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/kevin/.platformio/penv
Traceback (most recent call last):
  File "/home/kevin/get-platformio.py", line 68, in <module>
    main()
  File "/home/kevin/get-platformio.py", line 60, in main
    bootstrap()
  File "/home/kevin/get-platformio.py", line 46, in bootstrap
    pioinstaller.__main__.main()
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/pioinstaller/__main__.py", line 133, in main
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/click/core.py", line 1128, in __call__
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/click/core.py", line 1053, in main
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/click/core.py", line 1637, in invoke
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/click/core.py", line 1395, in invoke
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/click/core.py", line 754, in invoke
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/click/decorators.py", line 26, in new_func
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/pioinstaller/__main__.py", line 61, in cli
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/pioinstaller/core.py", line 70, in install_platformio_core
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/pioinstaller/core.py", line 98, in _install_platformio_core
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/pioinstaller/penv.py", line 71, in create_core_penv
  File "/home/kevin/.piocore-installer-etmlqwuf/tmpql56vpa7/pioinstaller.zip/pioinstaller/penv.py", line 141, in init_state
  File "/usr/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/kevin/.platformio/penv/bin/python'

Is this a python version issue?
Here is the result of Python --version:

kevin@kevin-CF-33S-1:~$ python --version
Python 3.11.2

When you rm -rf ~/.platformio before you run the installation script, does it install successfully?

Hello @maxgerhardt!
Yes, I did that, here is another attempt in full context:

kevin@kevin-CF-33S-1:~$ rm -rf ~/.platformio
kevin@kevin-CF-33S-1:~$ wget https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -O get-platformio.py
python3 get-platformio.py
--2023-07-04 19:11:17--  https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8003::154, 2606:50c0:8002::154, 2606:50c0:8001::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8003::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 929530 (908K) [text/plain]
Saving to: ‘get-platformio.py’

get-platformio.py   100%[===================>] 907.74K  1.32MB/s    in 0.7s    

2023-07-04 19:11:18 (1.32 MB/s) - ‘get-platformio.py’ saved [929530/929530]

Installer version: 1.1.3
Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.36
Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/kevin/.platformio/penv
Traceback (most recent call last):
  File "/home/kevin/get-platformio.py", line 68, in <module>
    main()
  File "/home/kevin/get-platformio.py", line 60, in main
    bootstrap()
  File "/home/kevin/get-platformio.py", line 46, in bootstrap
    pioinstaller.__main__.main()
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/pioinstaller/__main__.py", line 133, in main
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/click/core.py", line 1128, in __call__
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/click/core.py", line 1053, in main
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/click/core.py", line 1637, in invoke
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/click/core.py", line 1395, in invoke
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/click/core.py", line 754, in invoke
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/click/decorators.py", line 26, in new_func
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/pioinstaller/__main__.py", line 61, in cli
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/pioinstaller/core.py", line 70, in install_platformio_core
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/pioinstaller/core.py", line 98, in _install_platformio_core
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/pioinstaller/penv.py", line 71, in create_core_penv
  File "/home/kevin/.piocore-installer-kw24qaxz/tmpiw88f4sx/pioinstaller.zip/pioinstaller/penv.py", line 141, in init_state
  File "/usr/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/kevin/.platformio/penv/bin/python'
kevin@kevin-CF-33S-1:~$

I am starting to actually wonder if there may really be an issue with the install script???

Does this file exist?

If yes, what’s the output of

ldd ~/.platformio/penv/bin/python
readelf -l ~/.platformio/penv/bin/python
readelf -l $(which cat)

Here is my output:

kevin@kevin-CF-33S-1:~$ ldd ~/.platformio/penv/bin/python
readelf -l ~/.platformio/penv/bin/python
readelf -l $(which cat)
ldd: /home/kevin/.platformio/penv/bin/python: No such file or directory
readelf: Error: '/home/kevin/.platformio/penv/bin/python': No such file

Elf file type is DYN (Position-Independent Executable file)
Entry point 0x3770
There are 13 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x0000000000000040 0x0000000000000040
                 0x00000000000002d8 0x00000000000002d8  R      0x8
  INTERP         0x0000000000000318 0x0000000000000318 0x0000000000000318
                 0x000000000000001c 0x000000000000001c  R      0x1
      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000001478 0x0000000000001478  R      0x1000
  LOAD           0x0000000000002000 0x0000000000002000 0x0000000000002000
                 0x0000000000003c36 0x0000000000003c36  R E    0x1000
  LOAD           0x0000000000006000 0x0000000000006000 0x0000000000006000
                 0x00000000000012c0 0x00000000000012c0  R      0x1000
  LOAD           0x0000000000007ae0 0x0000000000008ae0 0x0000000000008ae0
                 0x0000000000000588 0x00000000000006d8  RW     0x1000
  DYNAMIC        0x0000000000007c40 0x0000000000008c40 0x0000000000008c40
                 0x00000000000001b0 0x00000000000001b0  RW     0x8
  NOTE           0x0000000000000338 0x0000000000000338 0x0000000000000338
                 0x0000000000000030 0x0000000000000030  R      0x8
  NOTE           0x0000000000000368 0x0000000000000368 0x0000000000000368
                 0x0000000000000044 0x0000000000000044  R      0x4
  GNU_PROPERTY   0x0000000000000338 0x0000000000000338 0x0000000000000338
                 0x0000000000000030 0x0000000000000030  R      0x8
  GNU_EH_FRAME   0x0000000000006db0 0x0000000000006db0 0x0000000000006db0
                 0x00000000000000b4 0x00000000000000b4  R      0x4
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     0x10
  GNU_RELRO      0x0000000000007ae0 0x0000000000008ae0 0x0000000000008ae0
                 0x0000000000000520 0x0000000000000520  R      0x1

 Section to Segment mapping:
  Segment Sections...
   00     
   01     .interp 
   02     .interp .note.gnu.property .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt 
   03     .init .plt .plt.got .plt.sec .text .fini 
   04     .rodata .eh_frame_hdr .eh_frame 
   05     .ctors .dtors .data.rel.ro .dynamic .got .data .bss 
   06     .dynamic 
   07     .note.gnu.property 
   08     .note.gnu.build-id .note.ABI-tag 
   09     .note.gnu.property 
   10     .eh_frame_hdr 
   11     
   12     .ctors .dtors .data.rel.ro .dynamic .got

Okay so the file really doesn’t exist. My hinch was that the “no such file” error can misleadingly alsoc occur when the executable file points at an interpreter (aka the loader of the linux kernel) that doesn’t exist. But /lib64/ld-linux-x86-64.so.2 is the same as on my machine.

Well then it stands to debug on whether the installer script successfully downloads the portable python installation and where it decompresses it to. Maybe it gets confused about the home path (releted?) or decompression fails. I think the only way to get closer to this is to copy get-platformio.py and add more debugging into it. The script looks its first deflating its second stage and that’s where the real stuff happens.

Fortunately the script does have some debug capabilities: You just have to unpack it first and invoke the script manually. I’ve uploaded the base64-decoding of what’s in the get-platformio.py script (aka, pioinstaller.zip) here: Deleted. You could also extract this yourself by modifying the end of get-platformio.py to just

def main():
    with open("pioinstaller.zip", "wb") as fp:
        fp.write(b64decode(DEPENDENCIES))

if __name__ == "__main__":
    main()

and running the script again.

You should be able to unzip the resulting file, cd into that directory and do a

$ python3 -m pioinstaller --help
Usage: python -m pioinstaller [OPTIONS] COMMAND [ARGS]...

Options:
  --version                       Show the version and exit.
  --verbose                       Verbose output
  --shutdown-piohome / --no-shutdown-piohome
  --dev
  --ignore-python TEXT            A path to Python to be ignored (multiple
                                  options and unix wildcards are allowed)
  --pypi-index-url TEXT           Custom base URL of the Python Package Index
                                  (default `https://pypi.org/simple`)
  --help                          Show this message and exit.

Commands:
  check
  pack

So then you can do

python3 -m pioinstaller --verbose

does that reveal some insights?

Okay, so i grabbed the installer script I had tried to use before, I updated the bottom with the b64 decode you showed, i got the zip, i unzipped it, and ran the verbose command and gotthis:

kevin@kevin-CF-33S-1:~/pioinstallerzipextract$ python3 -m pioinstaller --verbose
Installer version: 1.1.3
Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.36
Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/kevin/.platformio/penv
DEBUG: Current environment PATH /home/kevin/anaconda3/bin:/home/kevin/.npm-global/bin:/home/kevin/mxe/usr/i686-w64-mingw32.static/include/wx-3.1/:/home/kevin/mxe/usr/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/kevin/.local/bin:/home/kevin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
DEBUG: Checking a Python candidate /usr/bin/python3.10
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

DEBUG: Checking a Python candidate /bin/python3.10
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

DEBUG: Checking a Python candidate /usr/bin/python3
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

DEBUG: Checking a Python candidate /bin/python3
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

DEBUG: Checking a Python candidate /usr/bin/python
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

DEBUG: Checking a Python candidate /bin/python
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

Error: Could not find compatible Python 3.6 or above in your system.Please install the latest official Python 3 and restart installation:
https://docs.platformio.org/page/faq.html#install-python-interpreter
kevin@kevin-CF-33S-1:~/pioinstallerzipextract$

It keeps saying i don’t ahve pioinstaller, is that a pip package i am missing by any chance?

Mhh this is probably missing a setup step, sorry – the get-platformio.py does add the extract path to the $PATH with that sys.path.insert(0, pioinstaller_zip) command.

You should be able to do the same and execute

export PATH=$(pwd):$PATH

in the shell and then again python3 -m pioinstaller --verbose.

Added and showing a bit more context too:

kevin@kevin-CF-33S-1:~/pioinstallerzipextract$ python3 -m pioinstaller --help
Usage: python -m pioinstaller [OPTIONS] COMMAND [ARGS]...

Options:
  --version                       Show the version and exit.
  --verbose                       Verbose output
  --shutdown-piohome / --no-shutdown-piohome
  --dev
  --ignore-python TEXT            A path to Python to be ignored (multiple
                                  options and unix wildcards are allowed)
  --pypi-index-url TEXT           Custom base URL of the Python Package Index
                                  (default `https://pypi.org/simple`)
  --help                          Show this message and exit.

Commands:
  check
  pack
kevin@kevin-CF-33S-1:~/pioinstallerzipextract$ export PATH=$(pwd):$PATH
kevin@kevin-CF-33S-1:~/pioinstallerzipextract$ python3 -m pioinstaller --verbose
Installer version: 1.1.3
Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.36
Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/kevin/.platformio/penv
DEBUG: Current environment PATH /home/kevin/pioinstallerzipextract:/home/kevin/pioinstallerzipextract:/home/kevin/anaconda3/bin:/home/kevin/.npm-global/bin:/home/kevin/mxe/usr/i686-w64-mingw32.static/include/wx-3.1/:/home/kevin/mxe/usr/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/kevin/.local/bin:/home/kevin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
DEBUG: Checking a Python candidate /usr/bin/python3.10
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

DEBUG: Checking a Python candidate /bin/python3.10
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

DEBUG: Checking a Python candidate /usr/bin/python3
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

DEBUG: Checking a Python candidate /bin/python3
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

DEBUG: Checking a Python candidate /usr/bin/python
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

DEBUG: Checking a Python candidate /bin/python
DEBUG: Traceback (most recent call last):
  File "/home/kevin/pioinstallerzipextract/pioinstaller/__main__.py", line 22, in <module>
    from pioinstaller import __title__, __version__, core, exception, util
ModuleNotFoundError: No module named 'pioinstaller'

Error: Could not find compatible Python 3.6 or above in your system.Please install the latest official Python 3 and restart installation:
https://docs.platformio.org/page/faq.html#install-python-interpreter
kevin@kevin-CF-33S-1:~/pioinstallerzipextract$

(btw, I really appreciate the assistance, Thank you very much)

Something is still not right with the Python package paths if it doesn’t find the modules even though they should exactly all be in /home/kevin/pioinstallerzipextract/ – I’ll check it.

In the extracted folder, please create the file bootstrap.py

import sys
sys.path.insert(0, ".")
import pioinstaller.__main__
pioinstaller.__main__.main()

then

python3 bootstrap.py --verbose

My output:

output
$ python3 bootstrap.py --verbose
Installer version: 1.1.3
Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.35
Python version: 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/max/.platformio/penv
DEBUG: Current environment PATH /home/max/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/max/.local/bin:/home/max/Downloads/gcc-arm-none-eabi-10.3-2021.07/bin
DEBUG: Checking a Python candidate /usr/bin/python3.10
DEBUG: The Python 3.10.6 (/usr/bin/python3.10) interpreter is compatible.
DEBUG: Checking a Python candidate /bin/python3.10
DEBUG: The Python 3.10.6 (/bin/python3.10) interpreter is compatible.
DEBUG: Checking a Python candidate /usr/bin/python3
DEBUG: The Python 3.10.6 (/usr/bin/python3) interpreter is compatible.
DEBUG: Checking a Python candidate /bin/python3
DEBUG: The Python 3.10.6 (/bin/python3) interpreter is compatible.
DEBUG: Using /usr/bin/python3.10 Python for virtual environment.
DEBUG: Creating virtual environment: /usr/bin/python3.10 -m venv /home/max/.platformio/penv
Updating Python package manager (PIP) in a virtual environment
DEBUG: Creating pip.conf file in /home/max/.platformio/penv
DEBUG: Downloading 'get-pip.py' installer...
DEBUG: Installing pip
PIP has been successfully updated!
Virtual environment has been successfully created!
Installing PlatformIO Core
Collecting platformio
  Downloading platformio-6.1.7-py3-none-any.whl (418 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 419.0/419.0 kB 3.8 MB/s eta 0:00:00
Collecting bottle==0.12.* (from platformio)
  Downloading bottle-0.12.25-py3-none-any.whl (90 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.2/90.2 kB 7.8 MB/s eta 0:00:00
Collecting click<9,>=8.0.4 (from platformio)
  Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting colorama (from platformio)
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting marshmallow==3.* (from platformio)
  Using cached marshmallow-3.19.0-py3-none-any.whl (49 kB)
Collecting pyelftools<1,>=0.27 (from platformio)
  Using cached pyelftools-0.29-py2.py3-none-any.whl (174 kB)
Collecting pyserial==3.5.* (from platformio)
  Using cached pyserial-3.5-py2.py3-none-any.whl (90 kB)
Collecting requests==2.* (from platformio)
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB 6.3 MB/s eta 0:00:00
Collecting urllib3<2 (from platformio)
  Downloading urllib3-1.26.16-py2.py3-none-any.whl (143 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.1/143.1 kB 9.4 MB/s eta 0:00:00
Collecting semantic-version==2.10.* (from platformio)
  Using cached semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
Collecting tabulate==0.9.* (from platformio)
  Using cached tabulate-0.9.0-py3-none-any.whl (35 kB)
Collecting aiofiles==23.1.* (from platformio)
  Using cached aiofiles-23.1.0-py3-none-any.whl (14 kB)
Collecting ajsonrpc==1.* (from platformio)
  Using cached ajsonrpc-1.2.0-py3-none-any.whl (22 kB)
Collecting starlette==0.26.* (from platformio)
  Using cached starlette-0.26.1-py3-none-any.whl (66 kB)
Collecting uvicorn==0.22.* (from platformio)
  Using cached uvicorn-0.22.0-py3-none-any.whl (58 kB)
Collecting wsproto==1.2.* (from platformio)
  Using cached wsproto-1.2.0-py3-none-any.whl (24 kB)
Collecting packaging>=17.0 (from marshmallow==3.*->platformio)
  Downloading packaging-23.1-py3-none-any.whl (48 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 7.9 MB/s eta 0:00:00
Collecting charset-normalizer<4,>=2 (from requests==2.*->platformio)
  Downloading charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (199 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.3/199.3 kB 7.3 MB/s eta 0:00:00
Collecting idna<4,>=2.5 (from requests==2.*->platformio)
  Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting certifi>=2017.4.17 (from requests==2.*->platformio)
  Downloading certifi-2023.5.7-py3-none-any.whl (156 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 157.0/157.0 kB 9.0 MB/s eta 0:00:00
Collecting anyio<5,>=3.4.0 (from starlette==0.26.*->platformio)
  Downloading anyio-3.7.0-py3-none-any.whl (80 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.9/80.9 kB 7.8 MB/s eta 0:00:00
Collecting h11>=0.8 (from uvicorn==0.22.*->platformio)
  Using cached h11-0.14.0-py3-none-any.whl (58 kB)
Collecting sniffio>=1.1 (from anyio<5,>=3.4.0->starlette==0.26.*->platformio)
  Using cached sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting exceptiongroup (from anyio<5,>=3.4.0->starlette==0.26.*->platformio)
  Downloading exceptiongroup-1.1.2-py3-none-any.whl (14 kB)
Installing collected packages: pyserial, pyelftools, bottle, urllib3, tabulate, sniffio, semantic-version, packaging, idna, h11, exceptiongroup, colorama, click, charset-normalizer, certifi, ajsonrpc, aiofiles, wsproto, uvicorn, requests, marshmallow, anyio, starlette, platformio
Successfully installed aiofiles-23.1.0 ajsonrpc-1.2.0 anyio-3.7.0 bottle-0.12.25 certifi-2023.5.7 charset-normalizer-3.1.0 click-8.1.3 colorama-0.4.6 exceptiongroup-1.1.2 h11-0.14.0 idna-3.4 marshmallow-3.19.0 packaging-23.1 platformio-6.1.7 pyelftools-0.29 pyserial-3.5 requests-2.31.0 semantic-version-2.10.0 sniffio-1.3.0 starlette-0.26.1 tabulate-0.9.0 urllib3-1.26.16 uvicorn-0.22.0 wsproto-1.2.0

PlatformIO Core has been successfully installed into an isolated environment `/home/max/.platformio/penv`!

The full path to `platformio.exe` is `/home/max/.platformio/penv/bin/platformio`

If you need an access to `platformio.exe` from other applications, please install Shell Commands
(add PlatformIO Core binary directory `/home/max/.platformio/penv/bin` to the system environment PATH variable):

See https://docs.platformio.org/page/installation.html#install-shell-commands

Here is what I get:

kevin@kevin-CF-33S-1:~/pioinstallerzipextract$ nano bootstrap.py
kevin@kevin-CF-33S-1:~/pioinstallerzipextract$ python3 bootstrap.py --verbose
Installer version: 1.1.3
Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.36
Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/kevin/.platformio/penv
DEBUG: Current environment PATH /home/kevin/pioinstallerzipextract:/home/kevin/pioinstallerzipextract:/home/kevin/anaconda3/bin:/home/kevin/.npm-global/bin:/home/kevin/mxe/usr/i686-w64-mingw32.static/include/wx-3.1/:/home/kevin/mxe/usr/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/kevin/.local/bin:/home/kevin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
DEBUG: Checking a Python candidate /usr/bin/python3.10
DEBUG: The Python 3.10.6 (/usr/bin/python3.10) interpreter is compatible.
DEBUG: Checking a Python candidate /bin/python3.10
DEBUG: The Python 3.10.6 (/bin/python3.10) interpreter is compatible.
DEBUG: Checking a Python candidate /usr/bin/python3
DEBUG: The Python 3.11.2 (/usr/bin/python3) interpreter is compatible.
DEBUG: Checking a Python candidate /bin/python3
DEBUG: The Python 3.11.2 (/bin/python3) interpreter is compatible.
DEBUG: Checking a Python candidate /usr/bin/python
DEBUG: The Python 3.11.2 (/usr/bin/python) interpreter is compatible.
DEBUG: Checking a Python candidate /bin/python
DEBUG: The Python 3.11.2 (/bin/python) interpreter is compatible.
DEBUG: Using /usr/bin/python3.10 Python for virtual environment.
DEBUG: Creating virtual environment: /usr/bin/python3.10 -m venv /home/kevin/.platformio/penv
DEBUG: Creating virtual environment: /usr/bin/python3.10 -m virtualenv -p /usr/bin/python3.10 /home/kevin/.platformio/penv
Traceback (most recent call last):
File “/home/kevin/pioinstallerzipextract/bootstrap.py”, line 4, in
pioinstaller.main.main()
File “/home/kevin/pioinstallerzipextract/pioinstaller/main.py”, line 133, in main
return cli(obj={}) # pylint: disable=no-value-for-parameter, unexpected-keyword-arg
^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/click/core.py”, line 1128, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/click/core.py”, line 1053, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/click/core.py”, line 1637, in invoke
super().invoke(ctx)
File “/home/kevin/pioinstallerzipextract/click/core.py”, line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/click/core.py”, line 754, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/click/decorators.py”, line 26, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/pioinstaller/main.py”, line 61, in cli
core.install_platformio_core(shutdown_piohome, dev, ignore_python)
File “/home/kevin/pioinstallerzipextract/pioinstaller/core.py”, line 70, in install_platformio_core
return _install_platformio_core(
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/pioinstaller/core.py”, line 98, in _install_platformio_core
penv_dir = penv.create_core_penv(ignore_pythons=ignore_pythons)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/pioinstaller/penv.py”, line 71, in create_core_penv
init_state(python_exe, penv_dir)
File “/home/kevin/pioinstallerzipextract/pioinstaller/penv.py”, line 141, in init_state
subprocess.check_output(
File “/usr/lib/python3.11/subprocess.py”, line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/subprocess.py”, line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/subprocess.py”, line 1024, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “/usr/lib/python3.11/subprocess.py”, line 1901, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/kevin/.platformio/penv/bin/python’
kevin@kevin-CF-33S-1:~/pioinstallerzipextract$ cat bootstrap.py
import sys
sys.path.insert(0, “.”)
import pioinstaller.main
pioinstaller.main.main()
kevin@kevin-CF-33S-1:~/pioinstallerzipextract$

Integersting: So both Python 3.10.6 and Python 3.11.2 are installed on your system. It actually picks the older version.

It also seems to me that these two commands should create the /home/kevin/.platformio/penv in such a way that so that /home/kevin/.platformio/penv/bin/python is available.

  1. What are the contents of the /home/kevin/.platformio/penv folder now? (tree -v)
  2. Do rm -rf /home/kevin/.platformio/ again. Execute the above quoted two commands manually, although the latter might have to be executed with the /home/kevin/.platformio/penv folder. Does it throw any errors during execution? What’s the contents of the /home/kevin/.platformio/penv then?

This produces a massive list of files, but I hope this iswhat you were looking for, i truncated the bottom as itwas over 4k lines long:

#1
kevin@kevin-CF-33S-1:~/pioinstallerzipextract$ cd /home/kevin/.platformio/penv
kevin@kevin-CF-33S-1:~/.platformio/penv$ tree -v
.
├── lib
│ └── python3.10
├── local
│ ├── bin
│ │ ├── activate
│ │ ├── activate.csh
│ │ ├── activate.fish
│ │ ├── activate.nu
│ │ ├── activate.ps1
│ │ ├── activate_this.py
│ │ ├── deactivate.nu
│ │ ├── pip
│ │ ├── pip-3.10
│ │ ├── pip3
│ │ ├── pip3.10
│ │ ├── python → /usr/bin/python3.10
│ │ ├── python3 → python
│ │ ├── python3.10 → python
│ │ ├── wheel
│ │ ├── wheel-3.10
│ │ ├── wheel3
│ │ └── wheel3.10
│ └── lib
│ └── python3.10
│ └── dist-packages
│ ├── _distutils_hack

#2:
kevin@kevin-CF-33S-1:~/.platformio/penv$ cd …/
kevin@kevin-CF-33S-1:~/.platformio$ cd …/
kevin@kevin-CF-33S-1:~$ rm -rf /home/kevin/.platformio/
kevin@kevin-CF-33S-1:~$ /home/kevin/.platformio/penv
bash: /home/kevin/.platformio/penv: No such file or directory
kevin@kevin-CF-33S-1:~$ cd pioinstallerzipextract/
kevin@kevin-CF-33S-1:~/pioinstallerzipextract$ python3 bootstrap.py --verbose
Installer version: 1.1.3
Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.36
Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/kevin/.platformio/penv
DEBUG: Current environment PATH /home/kevin/pioinstallerzipextract:/home/kevin/pioinstallerzipextract:/home/kevin/anaconda3/bin:/home/kevin/.npm-global/bin:/home/kevin/mxe/usr/i686-w64-mingw32.static/include/wx-3.1/:/home/kevin/mxe/usr/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/kevin/.local/bin:/home/kevin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
DEBUG: Checking a Python candidate /usr/bin/python3.10
DEBUG: The Python 3.10.6 (/usr/bin/python3.10) interpreter is compatible.
DEBUG: Checking a Python candidate /bin/python3.10
DEBUG: The Python 3.10.6 (/bin/python3.10) interpreter is compatible.
DEBUG: Checking a Python candidate /usr/bin/python3
DEBUG: The Python 3.11.2 (/usr/bin/python3) interpreter is compatible.
DEBUG: Checking a Python candidate /bin/python3
DEBUG: The Python 3.11.2 (/bin/python3) interpreter is compatible.
DEBUG: Checking a Python candidate /usr/bin/python
DEBUG: The Python 3.11.2 (/usr/bin/python) interpreter is compatible.
DEBUG: Checking a Python candidate /bin/python
DEBUG: The Python 3.11.2 (/bin/python) interpreter is compatible.
DEBUG: Using /usr/bin/python3.10 Python for virtual environment.
DEBUG: Creating virtual environment: /usr/bin/python3.10 -m venv /home/kevin/.platformio/penv
DEBUG: Creating virtual environment: /usr/bin/python3.10 -m virtualenv -p /usr/bin/python3.10 /home/kevin/.platformio/penv
Traceback (most recent call last):
File “/home/kevin/pioinstallerzipextract/bootstrap.py”, line 4, in
pioinstaller.main.main()
File “/home/kevin/pioinstallerzipextract/pioinstaller/main.py”, line 133, in main
return cli(obj={}) # pylint: disable=no-value-for-parameter, unexpected-keyword-arg
^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/click/core.py”, line 1128, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/click/core.py”, line 1053, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/click/core.py”, line 1637, in invoke
super().invoke(ctx)
File “/home/kevin/pioinstallerzipextract/click/core.py”, line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/click/core.py”, line 754, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/click/decorators.py”, line 26, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/pioinstaller/main.py”, line 61, in cli
core.install_platformio_core(shutdown_piohome, dev, ignore_python)
File “/home/kevin/pioinstallerzipextract/pioinstaller/core.py”, line 70, in install_platformio_core
return _install_platformio_core(
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/pioinstaller/core.py”, line 98, in _install_platformio_core
penv_dir = penv.create_core_penv(ignore_pythons=ignore_pythons)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kevin/pioinstallerzipextract/pioinstaller/penv.py”, line 71, in create_core_penv
init_state(python_exe, penv_dir)
File “/home/kevin/pioinstallerzipextract/pioinstaller/penv.py”, line 141, in init_state
subprocess.check_output(
File “/usr/lib/python3.11/subprocess.py”, line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/subprocess.py”, line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/subprocess.py”, line 1024, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “/usr/lib/python3.11/subprocess.py”, line 1901, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/kevin/.platformio/penv/bin/python’
kevin@kevin-CF-33S-1:~/pioinstallerzipextract$ cd …/
kevin@kevin-CF-33S-1:~$ cd /home/kevin/.platformio/penv
kevin@kevin-CF-33S-1:~/.platformio/penv$ tree -v
.
├── lib
│ └── python3.10
├── local
│ ├── bin
│ │ ├── activate
│ │ ├── activate.csh
│ │ ├── activate.fish
│ │ ├── activate.nu
│ │ ├── activate.ps1
│ │ ├── activate_this.py
│ │ ├── deactivate.nu
│ │ ├── pip
│ │ ├── pip-3.10
│ │ ├── pip3
│ │ ├── pip3.10
│ │ ├── python → /usr/bin/python3.10
│ │ ├── python3 → python
│ │ ├── python3.10 → python
│ │ ├── wheel
│ │ ├── wheel-3.10
│ │ ├── wheel3
│ │ └── wheel3.10

…so it did create the virtual environment’s python but under ~/.platformio/penv/local/bin/python? Is that executable?

It is:

kevin@kevin-CF-33S-1:~/.platformio/penv$ ~/.platformio/penv/local/bin/python
Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.