ImportError: cannot import name 'cache' from 'functools'

Solution 1:

The documentation for functools.cache states that it's only available from Python 3.9 onwards. If you're using an earlier version then the documentation also states that it's the same as using lru_cache(maxsize=None), so that's probably your best option.