Installing and Troubleshooting pip and uv

Most Python installations ship with pip, but it can be missing, outdated, or not on your PATH. uv is a fast, Rust-based Python package manager that replaces pip and venv workflows and is especially useful when installing heavy security/RE toolchains.

Verify Python first

Before fixing pip/uv, confirm Python itself is installed:

python --version        # Windows / some macOS setups
python3 --version       # Linux / macOS Homebrew

If that fails, install Python from python.org or via your system package manager, then reopen the terminal.

Fixing pip

If pip is missing entirely

Use Python's built-in ensurepip module:

python -m ensurepip --upgrade
python -m pip --version

On Linux, prefer python3 -m pip over pip because distributions often do not put the bare pip shim on PATH.

If pip is outdated or broken

python -m pip install --upgrade pip --force-reinstall

Common causes

  • Installed Python without checking "Add Python to PATH" (Windows). Re-run the installer and select that option, or use py -m pip instead.
  • Linux python3-pip package not installed: sudo apt install python3-pip or sudo dnf install python3-pip.

Installing uv

Linux / macOS

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows (PowerShell)

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Restart the terminal, then verify:

uv --version

Basic uv workflow

uv pip install requests            # install a package
uv run python myscript.py        # run a script in a managed environment
uv venv .venv                    # create a virtual environment

Sanity check

uv pip install requests
uv run python -c "import requests; print(requests.__version__)"

If that prints a version number, both uv and package installation are working.

Related: Learning essential python for pentest and reverse engineering - Syllabus, Building Pentest and RE Automation Tools