How to use pymcuprog with PlatformIO?

I have a microUPDI programmer and I am trying to use PlatformIO for flashing my project.
Apparently pymcuprog seems quite stable in the normal terminal window, but for some reason it refuses to run when under PlatformIO.
It is as if PlatformIO uses python27?

Please help!

OS: Mac OS 14.2.1 on Apple Silicone

"AVAILABLE: custom
CURRENT: upload_protocol = custom
pymcuprog write --erase -d attiny814 --filename .pio/build/Upload_UPDI/firmware.hex
Connecting to anything possible
pymcuprog.pymcuprog - ERROR - Operation failed with ImportError: This transport class requires cython and hidapi to be installed:

pip install cython
pip install hidapi

*** [upload] Error 1"

PlatformIO operates in its own Python enviornment. Did you install pymcuprog in that environment? You usually have to go into a terminal and dome something of the likes

cd ~/.platformio/penv/bin

first to activate the envrionment. Then, pip install will install into the right environment.