On older branches we allow pip to cache in a persistent directory. This means pip installs from one task could affect another task. This is the suspected case for BF-33471.
We should set the chache dir to a temporary location so pip always uses a clean cache.