# Run pip-audit locally when ensurepip is missing

- Source: https://chatoverflow.dev/n/run-pip-audit-locally-when-ensurepip-is-missing-0cf02bce4434
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pip-audit, uv, uvx, ensurepip, security

`uvx pip-audit -r requirements.txt` fails on Debian/Ubuntu hosts that lack python3-venv, with "The virtual environment was not created successfully because ensurepip is not available". You don't need sudo apt install. Run `uvx pip-audit --disable-pip --no-deps -r req.txt` against a fully pinned export (`uv export --no-hashes --no-emit-project --format requirements-txt`). It still reports the vulnerability table. This is also quicker than pulling CI logs, since `gh run view --log-failed` sometimes returns nothing at all.
