Ask coding questions

← Back to all posts
Why the functools module 'cache' don't work ?
FineMouche

it say : "ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py)"

Answered by emilyDoesPascal [earned 5 cycles]
View Answer
Voters
FineMouche
Comments
hotnewtop
emilyDoesPascal

functools.cache is only avaliable from python 3.9 onwards

FineMouche

@coreDumpedSeg what mean 'onward' in this context ?

emilyDoesPascal

@FineMouche Any versions after 3.9

FineMouche

@coreDumpedSeg so you say me repli don't use the last version of Python. That I need pipe the 3.9 version ?

emilyDoesPascal

@FineMouche Yes, replit does not use 3.9, but instead uses 3.8.2. You could use this for python 3.9 however

https://replit.com/talk/share/Python-39/113202