Skip to content

pip 25.3 breaks pip-tools 7.5.1 on Windows — AttributeError when copying InstallRequirement (use_pep517) #140674

@rsvix

Description

@rsvix

Bug report

Bug description:

Steps to reproduce

Create a venv on Windows (tested on Windows 10/11).
Activate venv.
Install pip 25.3 and pip-tools 7.5.1: python -m pip install --upgrade "pip==25.3" pip-tools==7.5.1
Run pip-compile (e.g. pip-compile requirements.in).

Observed behavior pip-compile fails with a traceback ending in pip-tools trying to copy an InstallRequirement and referencing use_pep517. Example tail of traceback:

File '', line 198, in _run_module_as_main ... File '...\venv\Lib\site-packages\piptools_compat\pip_compat.py', line 115, in parse_requirements install_req = copy_install_requirement(install_req) File '...\venv\Lib\site-packages\piptools\utils.py', line 503, in copy_install_requirement 'use_pep517': template.use_pep517,

Additional diagnostic output

python -m pip --version pip 25.3 from C:\Users\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip (python 3.13)
python -m pip show pip-tools Version: 7.5.1
python -c "import pip; import inspect; print(hasattr(getattr(pip._internal.req, 'InstallRequirement', None),'use_pep517') if hasattr(pip,'_internal') else 'pip internal not available')" pip internal not available

Expected behavior pip-tools 7.5.1 should be compatible with pip 25.x or at least fail with a clear compatibility error. Specifically, pip-compile should not crash when handling InstallRequirement objects.

Notes / Analysis

It appears pip 25.3 removed or changed access to pip internals (pip._internal.req / InstallRequirement) on this environment, causing pip-tools to receive objects without the expected attributes (use_pep517 or the InstallRequirement class itself not importable).
This reproduces on a fresh venv with pip 25.3 and pip-tools 7.5.1 installed.
Workarounds that worked for me:

Downgrading pip to 24.x (e.g., pip==24.4.1) in the environment

CPython versions tested on:

3.12

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions