AttributeError: module 'functools' has no attribute 'cached_property'

Hi Nakul, welcome to the forum.

For future questions, please read the pinned thread in order to understand how to make code and error message appear with proper formatting here. This makes it much easier for us to help you, because of how important the code indentation is in Python.

This doesn’t tell us anything useful. Anyone can make a project and call it “stylometric-analysis-main”.

If you mean, for example, a specific project on GitHub - in general, the best way to get help is to read the documentation there and then check the project’s issue tracker. If it’s someone else’s code and it isn’t working for you “out of box”, chances are the people who wrote it will have the best idea of what is wrong - because they’re the ones responsible for writing it, testing it, making it installable, and telling you how to install it.

Of course, we’re always happy to take a look.

This is straightforward. The code is trying to use a feature that Python 3.7 does not support. Aside from that, Python 3.7 is no longer supported. Neither is Windows 7. Nowadays it’s necessary to keep your tools up to date.

One useful technique for the future is to try copying and pasting the message into a search engine. When I try this, I immediately see several other Github issue tracker reports for other projects, and all of them involve some similar case: the OP is trying to use some code on Python 3.7, and gets told that a newer Python is necessary.

Another way is to try to look up the function or method that broke. If we search only for functools.cached_property, we find out right off the top that it comes from the Python standard library; and if we look for cached_property on that documentation page, it says at the bottom of the section that this is “New in version 3.8.”.

3 Likes