Error Knowledge Base PIP RECORD_FILE_NOT_FOUND

ERROR: Cannot uninstall <pkg>, RECORD file not found.

pip cannot uninstall a package because it cannot find the installed-files manifest (`RECORD`) in the package metadata.

Affected versions: All pip versions (depends on how the package was installed).

What This Error Means

pip cannot uninstall a package because it cannot find the installed-files manifest (RECORD) in the package metadata.

How to Fix It

  1. If the package is owned by the OS, uninstall it using the OS package manager instead of pip.
  2. If it is not system-owned, try reinstalling the exact version with --force-reinstall --no-deps, then uninstall again.
  3. Prefer using a venv for project dependencies so uninstall operations are fully pip-managed.

Why It Happens

  • The package was installed by a distro package manager that doesn't provide pip uninstall metadata.
  • The package's dist-info metadata was partially removed or corrupted.
  • You're trying to uninstall a package outside the active environment/prefix.

How to Verify

  1. Re-run python -m pip uninstall <pkg> and confirm it completes.
  2. Run python -m pip show <pkg> and confirm it's no longer installed.

Manual uninstall ownership checks

  1. Confirm whether the package was installed by your OS package manager (the error often hints "installed by debian" / "installed by rpm").
  2. Check which environment you're modifying (system Python vs venv).
  3. List package location: python -m pip show <pkg>.

Common CLI Output

ERROR: Cannot uninstall pip 24.0, RECORD file not found. Hint: The package was installed by debian.
ERROR: Cannot uninstall foobar 0.1, RECORD file not found. You might be able to recover from this via: 'pip install --force-reinstall --no-deps foobar==0.1'.

Why pip needs RECORD to uninstall

  1. pip uninstalls packages by reading the list of installed files from metadata (typically dist-info/RECORD).
  2. If that metadata isn't present (or doesn't include RECORD), pip cannot safely remove files and refuses.
  3. This often happens when the OS package manager installed the package, or metadata was deleted/corrupted.

Prevention Tips

  • Avoid using pip to manage packages in system Python on distro-managed systems.
  • Use virtual environments for projects.
  • Avoid deleting dist-info directories manually, use pip uninstall instead.

Where This Can Be Triggered

github.com/pypa/pip/blob/25.3/src/pip/_internal/exceptions.py

pip raises this diagnostic when it can't find a package's installed-files manifest (dist-info/RECORD), and it changes the hint depending on whether the package appears to have been installed by pip or by another installer. - GitHub

class UninstallMissingRecord(DiagnosticPipError):
    reference = "uninstall-no-record-file"

    def __init__(self, *, distribution: BaseDistribution) -> None:
        installer = distribution.installer
        if not installer or installer == "pip":
            dep = f"{distribution.raw_name}=={distribution.version}"
            hint = Text.assemble(
                "You might be able to recover from this via: ",
                (f"pip install --force-reinstall --no-deps {dep}", "green"),
            )
        else:
            hint = Text(
                f"The package was installed by {installer}. "
                "You should check if it can uninstall the package."
            )

        super().__init__(
            message=Text(f"Cannot uninstall {distribution}"),
            context=(
                "The package's contents are unknown: "
                f"no RECORD file was found for {distribution.raw_name}."
            ),
            hint_stmt=hint,
        )

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list