Assertion error when installing PlatformIO

Hello,

I’m trying to install the PlatformIO extension on my Raspberry Pi using a Remote SSH connection from VS.Code on my Windows machine.

Near the end of the installation I’m getting this error:

Error: Error: Compatible PlatformIO Core not found.
Reason: Could not run /home/pi/.platformio/penv/bin/platformio --help.
Error: Traceback (most recent call last):
  File "/home/pi/.platformio/penv/lib/python3.9/site-packages/platformio/project/helpers.py", line 74, in get_default_projects_dir
    assert IS_WINDOWS
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/.platformio/penv/bin/platformio", line 5, in <module>
    from platformio.__main__ import main
  File "/home/pi/.platformio/penv/lib/python3.9/site-packages/platformio/__main__.py", line 21, in <module>
    from platformio import __version__, ...

Any ideas?

Thanks!

Download + execute the installer script to preinstall the PlatformIO core.

Note that on Linux systems, this does need

sudo apt install python3-venv

beforehand.

Don’t forget to uninstall udev rules, too.

Thank you Max, however the issue remains.

I ran the installer script and got a confirmation the installation was successfull.

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

The full path to `platformio.exe` is `/home/pi/.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/pi/.platformio/penv/bin` to the system environment PATH variable):

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

But when I start VS.Code, and activate the PIO extension the installer in VS.Code is running for a few minutes, and at the end I’m getting the exact same error as before.

It seems to try to determine the default path to the projects directory there.

Try in order:

  1. mkdir -p ~/Documents/PlatformIO/Projects
  2. sudo apt install *xdg-user-dirs*

Problem solved. Creating the ‘Projects’ folder did the trick!

Thank you for your assistance Max. Greatly appreciated.

1 Like