Can not find working Python 3.6+ interpreter because of missing python-venv

Aperta
#393 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
documentation

Direzione di ricerca

Inizia esaminando i requisiti di installazione di PlatformIO e la configurazione dell’ambiente virtuale che esegue python3 -m venv ~/.platformio/penv; l’issue non indica alcun file di documentazione né alcun test. Verifica se questo repository debba documentare il requisito python3-venv di Debian/Ubuntu o se l’errore dell’installer debba essere gestito altrove. L’attività è completata quando la dipendenza venv mancante e le indicazioni risultanti per l’utente sono documentate chiaramente o indirizzate al componente corretto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I hope you don't mind that I used AI for that.

This happens even when a fully valid Python 3.12 interpreter is present and works normally.
The actual underlying issue is that the system is missing the python3-venv package, which PlatformIO needs to create its internal virtual environment.
However, the error message does not indicate this, leading users to believe their Python path or version is invalid.

This results in unnecessary confusion (e.g., users thinking they need to install Python 3.6 or a different interpreter path).

🔁 Steps to Reproduce

Use a Linux machine (e.g., Ubuntu/Mint/Debian) with:

python3 installed

but without python3-venv

Connect to the machine using VS Code Remote SSH from a Windows host.

Install the PlatformIO extension in the remote environment.

When prompted for a Python path, provide /usr/bin/python3 (which is Python 3.12.3 or similar).

PlatformIO reports:

Can not find working Python 3.6+ interpreter

✔️ Expected Behavior

PlatformIO should:

Detect that Python 3.6+ exists and is valid.

If venv support is missing, show a clear, actionable message, such as:

“Python interpreter is valid, but Python’s ‘venv’ module is missing.
Please install python3-venv and retry.”

❌ Actual Behavior

PlatformIO incorrectly reports that the Python interpreter is invalid or unsupported.

Users believe they must install Python 3.6 or provide a different path.

The real issue (missing python3-venv) is not mentioned.

🧪 Environment

Remote OS: Linux (Ubuntu/Mint/Debian family)

Python: /usr/bin/python3 → Python 3.12.3

Missing package: python3-venv

VS Code Remote SSH from Windows

PlatformIO extension latest version

🔍 Diagnosis

The installer attempts to create a virtual environment with:

python3 -m venv ~/.platformio/penv

This fails silently when python3-venv is missing.

PlatformIO then falls back to a generic error about “Python 3.6+” instead of telling the user the real failure cause.

Once the user installs:

sudo apt install python3-venv

the installer works immediately, and /usr/bin/python3 is accepted without issues.

💡 Suggested Fixes
Option A (Preferred): Improve error message

Detect missing venv module and show:

“Python is installed, but the ‘venv’ module is missing.
Please install python3-venv.”

Option B: Pre-check for venv

Before attempting venv creation, run:

import venv

If it fails, show a clear diagnostic.

Option C: Add documentation note

Add to installation requirements:

“Debian/Ubuntu users must install python3-venv to allow PlatformIO to create a virtual environment.”

Lingua principale
Python
Stelle
288
Fork
361
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di platformio/platformio-docs

Tutte le issue di platformio/platformio-docs

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.