Como corrigir PlatformIO: 'Can not find working Python 3.6+ interpreter' no Linux

Problema:

Ao tentar abrir PlatformIO no Visual Studio Code, você vê a seguinte mensagem de erro:

error.txt
PlatformIO: Can not find working Python 3.6+ Interpreter. Please install the latest Python 3 and restart VSCode

Mensagem de erro VSCode mostrando PlatformIO não consegue encontrar interpretador Python 3.6 funcionando

mesmo que você já tenha Python3 instalado.

Solução

O problema aqui não é que PlatformIO não consiga encontrar Python 3, é que você não tem venv (ambientes virtuais) instalado para sua versão Python!

No Ubuntu/Debian, você pode instalá-lo usando

install_venv.sh
sudo apt -y install python3-venv

Alternativamente você pode instalá-lo usando pip:

install_virtualenv.sh
pip install virtualenv

Check out similar posts by category: PlatformIO Python