Python DEPRECATION warning and pip --no-cache-dir breakage
Today, Python 2.7’s pip started echoing the following:
Simultaneously (and perhaps related, though perhaps coincidentally) Python 2.7’s pip started giving the following error:
Looking at the wheel.py source, there is a TODO above the the assert building_is_possible
line:
Sure enough, we are using the --no-cache-dir
option when we call pip.
Removing the call to --no-cache-dir
fixes the AssertionError
, however we still need pip to not use cached packages.
As a workaround, we can empty the entire pip cache.
The pip cache has a different location depending upon the OS.
- Windows:
%LOCALAPPDATA%\pip\Cache
- Linux:
~/.cache/pip
(We call DEL
and RMDIR
because otherwise we get “The directory is not empty”.)
It is unclear whether the DEPRECATION
message and the AssertionError
from --no-cache-dir
are related, but in this case neither pip nor Python 2.7 were upgraded – these both seemingly started on their own accord.