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
- Delete
.venv and recreate it
- Install
pip-tools in the new venv manually using pip install pip-tools (this will install version 7.5.0)
- 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
When running
pip-syncagainst a requirements.txt which includes a different version of pip-tools itself, it tries to remove it, which causes an OSError.Environment Versions
Windows 103.12.524.2 (venv)and25.2 (machine)7.5.0Steps to replicate
.venvand recreate itpip-toolsin the new venv manually usingpip install pip-tools(this will install version 7.5.0)pip-syncagainst a requirements.txt which pinspip-toolsto 7.4.1Expected result
pip-syncdoes not modify packaging tools like itself and simply skipspip-toolsunless it's not installedActual result
pip-synctries to uninstall itself and hence tries removing the executable it's running from causing anOSError