Pio home can't find platformio

I just installed PlatformIO Core.

When I run pio home and then go to Inspect my project, I see this error message:

PIO Core Call Error: “[Errno 2] No such file or directory: ‘platformio’”

I don’t get it, I have platformio on my PATH and I can run it from any directory. Yet, this doesn’t work.

montag:~ $ pio system info
--------------------------  -----------------------------------------
PlatformIO Core             5.2.4
Python                      3.9.7-final.0
System Type                 darwin_x86_64
Platform                    macOS-10.15.6
File System Encoding        utf-8
Locale Encoding             UTF-8
PlatformIO Core Directory   /Users/montag/.platformio
PlatformIO Core Executable  platformio
Python Executable           /Users/montag/.platformio/penv/bin/python
Global Libraries            0
Development Platforms       1
Tools & Toolchains          6
--------------------------  -----------------------------------------

Ok, solved it, hopefully this can help someone else:

I added platformio to my PATH with

export PATH="$PATH:~/.platformio/penv/bin"

This is wrong - at least for macOS, it needs to be:

export PATH="$PATH:$HOME/.platformio/penv/bin"

This came from the documentation https://github.com/platformio/platformio-docs/blob/develop/core/installation.rst (just submitted a PR).