Description
PlatformIO's tool manager internally calls pip install to install Python-based tool dependencies (e.g., esptool crypto dependencies), but pip is not listed in platformio/dependencies.py.
Modern Python tool runners (pipx, uvx, uv tool install) create isolated virtual environments that only include declared dependencies. Since pip is not declared, it is absent from the environment, and tool installation fails with:
ModuleNotFoundError: No module named 'pip'
Reproduction
pipx install platformio
pio run -e esp32dev # fails when trying to install esptool dependencies
Proposed Fix
Option A (one-line fix): Add pip to get_pip_dependencies() in dependencies.py:
def get_pip_dependencies():
return [
"pip",
# ... existing dependencies
]
Option B (long-term): Refactor the tool manager to use importlib and direct wheel installation instead of shelling out to pip. This removes the runtime dependency entirely.
Context
Related to #5305. The Python ecosystem is rapidly moving toward uv-based tooling, making this an increasingly common failure mode for new users.
Description
PlatformIO's tool manager internally calls
pip installto install Python-based tool dependencies (e.g., esptool crypto dependencies), butpipis not listed inplatformio/dependencies.py.Modern Python tool runners (
pipx,uvx,uv tool install) create isolated virtual environments that only include declared dependencies. Sincepipis not declared, it is absent from the environment, and tool installation fails with:Reproduction
pipx install platformio pio run -e esp32dev # fails when trying to install esptool dependenciesProposed Fix
Option A (one-line fix): Add
piptoget_pip_dependencies()independencies.py:Option B (long-term): Refactor the tool manager to use
importliband direct wheel installation instead of shelling out topip. This removes the runtime dependency entirely.Context
Related to #5305. The Python ecosystem is rapidly moving toward
uv-based tooling, making this an increasingly common failure mode for new users.