I had some issues with Python when switching to PlatformIO from the Arduino IDE.
I had an older version of python installed, so I thought I would be slick and update before installing Visual Code and the PlatfromIO plugin. That is where I messed up and PlatformIO was pissed.
What alleviated my issues were completely uninstalling all python and Visual Code bits, and reinstalling them together. When you download and install the PlatformIO plugin it looks for the path to the python.exe. If it can’t find it, or you tell it incorrectly, and it is crazy picky on the verbiage, it will become upset and provide you a link to go download it. Do this, and follow the prompts. Make sure you check the box to add python to the path! this is critical.
Ensure that your path is correct within PlatformIO, but if you let PlatfromIO take the wheel it will remember where it was saved.
Having only ever played with the Arduino IDE, I too struggled to get PlatfromIO going. But it is superior and I probably won’t go back to the Arduino IDE.