Cache Python directories.