[Solved] ImportError: cannot import name ‘cached_property’ from ‘werkzeug’

After querying, I learned that this is because the module needs to be explicitly imported in the new version of werkzeug.
Add the following code to the error file (here is werkzeug/init.py) to solve the problem.

from werkzeug.utils import cached_property

Remark:

File path under CentOS system: /usr/local/lib/python3. 7 /site-packages/ werkzeug
File path under Ubuntu system: /usr/local/lib/python3. 6 /dist-packages/ werkzeug
File path under MAC system: /usr/local/lib/python3. 7 /site-packages/werkzeug

end!

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *