You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pip-compile errors when generating hashes with AttributeError 'cache_clear' with pip v25.1 #2176
Caused by pypa/pip#13306 - you may want to catch AttributeError when running finder.find_all_candidates.cache_clear(), then attempt to run finder._all_candidates.clear()
Workaround
Use pip v25.0 or lower
pip install 'pip < 25.1'
Reacted by Marcus Windmark, Marko Kohtala, Albert Evans, Jussi Kukkonen, Christopher McMahon, Jace Isaeff, William Woodruff, Andrew Naoum, FrancisM, Gunnar Kreitz and 53 more
Reacted by Albert Evans, Jace Isaeff, Nada Saiyed, wsxrdv, kralka, Alexander Saveyko, Tessa Alexander-Holmes, Rebecca Robb, Jonathan Renon, Boris Faure and 4 more
pypa/pip@24f4600 seems to be the pip commit that broke this. It replaces @lru_cache with a custom cache that can no longer be cleared (afaict).
It seems to me like a potential route to fix this would be to re-build the finder object instead of trying to clear the cache on it. I.e., replace self.finder.find_all_candidates.cache_clear() with self._finder = self.command._build_package_finder(...).
I'm not sufficiently familiar with pip/pip-tools internals to know if that's a bad idea for other reasons (it's unclear to me how much state lies in the finder object, beyond the cache).
That "Cron" workflow has been busted for a while and is misleading (sorry!). I'd advise anyone looking at pip-tools CI to ignore it for now; I haven't decided yet if I want to try to fix it or just remove it to replace later.
CI runs triggered by commits for main should be stable right now -- we aren't testing against the newer pip versions in that workflow, so that builds are more reproducible.
We have a contribution which fixes this particular issue (#2178), and I've taken that work and rebased it as part of #2195, but I unfortunately got stuck on some Windows path shenanigans and haven't got that cleaned up yet. The new tests ended up exploring some subtle and slightly weird behavior in pip internals (which is not user-facing in pip, but which pip-compile is exposing 😢 ).
I consider support for the latest pip version the main issue which prevents me from wanting to push out a release, so if I can get #2195 across the finish line, we can incorporate some final fixes and hopefully have this issue fixed. Huge thanks to everyone who has chipped in on this effort, by the way!
Reacted by Tal Einat, Laurie O and 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
Our renovatebot setup with pip-compile manager is broken because of this with the same error. Seems it uses pip-tools 7.4.1 (from March 2024). Can you please create a new release with the fix?
I haven't had much time for FOSS work this week, but we're getting the changelog cleaned up so that we can push a release.
I'm not sure what the best way is to communicate this publicly, but we are getting asked in multiple threads about this. We're well aware that a release is needed; there's only one thing left in the 7.5.0 milestone.
Reacted by Christoph Ludwig
Reacted by Udaya Prakash
Reacted by Noelle Leigh, Udaya Prakash, 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) and James Gerity
Activity
ericscales commentedon Apr 27, 2025
Running into this as well.
Pin `pip` to 25.0.1
Pin `pip` to 25.0.1
Pin pip < 25.1
Pin pip < 25.1
Pin pip
gkreitz commentedon Apr 29, 2025
pypa/pip@24f4600 seems to be the pip commit that broke this. It replaces
@lru_cachewith a custom cache that can no longer be cleared (afaict).It seems to me like a potential route to fix this would be to re-build the finder object instead of trying to clear the cache on it. I.e., replace
self.finder.find_all_candidates.cache_clear()withself._finder = self.command._build_package_finder(...).I'm not sufficiently familiar with pip/pip-tools internals to know if that's a bad idea for other reasons (it's unclear to me how much state lies in the finder object, beyond the cache).
Pip `pip` to 25.0.1
Pip `pip` to 25.0.1
Pip `pip` to 25.0.1
Pin `pip` to 25.0.1
Pin `pip` to 25.0.1
Pin `pip` to 25.0.1
cesarcoatl commentedon May 1, 2025
Has anyone considered using
uv pip compile?I just tried it in one of my projects and it worked without issues.
Pin pip version due to piptools error
30 remaining items
pin pip==24.3.1 for pip-tools compatibility
Temporarily ignore issues pypa#2131 and pypa#2176 (and any other pip …
🔧 requirements.txt: Harden against supply chain attacks.
taleinat commentedon Jul 3, 2025
Looking at a recent CI test run, it seems that this issue is what causes at least some of the tests to fail:
https://github.com/jazzband/pip-tools/actions/runs/16041294513/job/45263254425#step:10:5449
sirosen commentedon Jul 3, 2025
That "Cron" workflow has been busted for a while and is misleading (sorry!). I'd advise anyone looking at pip-tools CI to ignore it for now; I haven't decided yet if I want to try to fix it or just remove it to replace later.
CI runs triggered by commits for
mainshould be stable right now -- we aren't testing against the newerpipversions in that workflow, so that builds are more reproducible.We have a contribution which fixes this particular issue (#2178), and I've taken that work and rebased it as part of #2195, but I unfortunately got stuck on some Windows path shenanigans and haven't got that cleaned up yet. The new tests ended up exploring some subtle and slightly weird behavior in pip internals (which is not user-facing in pip, but which pip-compile is exposing 😢 ).
I consider support for the latest pip version the main issue which prevents me from wanting to push out a release, so if I can get #2195 across the finish line, we can incorporate some final fixes and hopefully have this issue fixed. Huge thanks to everyone who has chipped in on this effort, by the way!
taleinat commentedon Jul 3, 2025
Thanks for the info, the update and your work on this @sirosen!!
EpicWink commentedon Jul 14, 2025
@sirosen @webknjaz I've successfully tested 757e62f (which includes #2195), verifying this is issue fixed
webknjaz commentedon Jul 14, 2025
@EpicWink thanks for verifying!
udaya2899 commentedon Jul 24, 2025
Our renovatebot setup with pip-compile manager is broken because of this with the same error. Seems it uses pip-tools 7.4.1 (from March 2024). Can you please create a new release with the fix?
sirosen commentedon Jul 24, 2025
We're actively working on it.
I haven't had much time for FOSS work this week, but we're getting the changelog cleaned up so that we can push a release.
I'm not sure what the best way is to communicate this publicly, but we are getting asked in multiple threads about this. We're well aware that a release is needed; there's only one thing left in the 7.5.0 milestone.
webknjaz commentedon Jul 31, 2025
https://pypi.org/project/pip-tools/7.5.0/#pip_tools-7.5.0-py3-none-any.whl
Unpin pip