Fix it fast
Most likely: pip cannot find the package's RECORD file, so it does not know which files are safe to remove. The package may be OS-managed, or its pip metadata may be damaged.
1. Confirm this is your error
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'. 2. Check the cause
python -m pip show <pkg>
python -m pip --version
python -m pip check 3. Apply the safe fix
# If the error says the package was installed by the OS, uninstall it with the OS package manager instead of pip.
# If it was pip-managed but metadata is damaged, reinstall the exact version without dependencies, then uninstall.
python -m pip install --force-reinstall --no-deps <pkg>==<version>
python -m pip uninstall <pkg>
# For project work, the cleanest fix is often a fresh venv. 4. Verify it works
python -m pip show <pkg>
python -m pip check Don't use unsafe shortcuts
- Do not delete package files manually unless you fully understand the environment layout.
- Do not use pip to uninstall packages owned by Debian, RPM, Homebrew, or another system package manager.
- Do not keep project dependencies in system Python when a venv avoids this class of uninstall problem.
What pip Could Not Find
pip cannot uninstall a package because it cannot find the installed-files manifest (RECORD) in the package metadata.
Check the exact package name, version, and source
Confirm whether the package was installed by your OS package manager (the error often hints "installed by debian" / "installed by rpm").
Check which environment you're modifying (system Python vs venv).
List package location:python -m pip show <pkg>
Confirm the exact package you asked for
If the package is owned by the OS, uninstall it using the OS package manager instead of pip.
If it is not system-owned, try reinstalling the exact version with --force-reinstall --no-deps, then uninstall again.
Prefer using a venv for project dependencies so uninstall operations are fully pip-managed.
Why It Was Not Found
Usually this comes down to 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, or you're trying to uninstall a package outside the active environment/prefix.
Prove the Source Resolves Correctly Now
Re-run python -m pip uninstall <pkg> and confirm it completes, and run python -m pip show <pkg> and confirm it's no longer installed.
Why pip needs RECORD to uninstall
pip uninstalls packages by reading the list of installed files from metadata (typically dist-info/RECORD). If that metadata isn't present (or doesn't include RECORD), pip cannot safely remove files and refuses. This often happens when the OS package manager installed the package, or metadata was deleted/corrupted.
Avoid Version and Source Drift
To prevent this, avoid using pip to manage packages in system Python on distro-managed systems, use virtual environments for projects, and avoid deleting dist-info directories manually, use pip uninstall instead.
Docs and source code
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,
)