Skip to content

pip-sync tries to uninstall itself (pip-tools) #2229

@CaptainException

Description

@CaptainException

When running pip-sync against a requirements.txt which includes a different version of pip-tools itself, it tries to remove it, which causes an OSError.

Environment Versions

  • OS version: Windows 10
  • Python version: 3.12.5
  • pip version: 24.2 (venv) and 25.2 (machine)
  • pip-tools version: 7.5.0

Steps to replicate

  1. Delete .venv and recreate it
  2. Install pip-tools in the new venv manually using pip install pip-tools (this will install version 7.5.0)
  3. Run pip-sync against a requirements.txt which pins pip-tools to 7.4.1

Expected result

pip-sync does not modify packaging tools like itself and simply skips pip-tools unless it's not installed

Actual result

pip-sync tries to uninstall itself and hence tries removing the executable it's running from causing an OSError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions