CircleCI save_cache path not found / nothing to cache in CI
A save_cache step listed a path that did not exist when it ran, so the saved cache is empty or skipped. Later restore_cache calls then have nothing useful to load.
What this error means
save_cache warns that the path was skipped or does not exist, and dependency restores never speed up because the cache is empty.
Saving cache
* Skipping path '/home/circleci/.cache/pip' since it does not existCommon causes
The path is wrong for this image
The cache path does not match where the tool actually writes on this executor (home directory or tool cache location differs).
save_cache runs before the path is populated
The cache step runs before the install that creates the directory, so there is nothing to store.
How to fix it
Cache the real directory after it exists
- Confirm where the tool writes its cache on this image.
- Run the install first, then
save_cache. - List the exact populated path.
- run: pip install -r requirements.txt
- save_cache:
key: pip-v1-{{ checksum "requirements.txt" }}
paths:
- ~/.cache/pipVerify the path before caching
Print the directory so a wrong path is obvious in the log.
- run: ls -ld ~/.cache/pip || echo "path missing"How to prevent it
- Cache paths that the tool actually writes on the runner image.
- Order save_cache after the populating step.
- Verify cache paths exist in the job log.