getting module 'abc' has no attribute 'update_abstractmethods' error when installing/uninstalling a package

59 Views Asked by At

starting from a few days ago every time I try downloading any packages to my environment (or pip installing directly through the terminal) and/or delete/uninstall an existing package in my envirinemt, I'm getting a package install/uninstall failure error: File "C:\Users\user_name\AppData\Local\Programs\Python\Python39\lib\site-packages\attr_make.py", line 740, in build_class return self.abc.update_abstractmethods( AttributeError: module 'abc' has no attribute 'update_abstractmethods'.

I made sure that abc library is importable (no issues). 2. on the _make.py file I traced the build class function, and it looks like that:

if PY310:
import abc
def build_class(self):
"""
Finalize class based on the accumulated configuration.
Builder cannot be used after calling this method.
"""
if self._slots is True:
return self._create_slots_class()
return self.abc.update_abstractmethods(
self._patch_original_class()
)

it's important to mention that all existing scripts and libraries up until the problem started is working fine, just can't seem to be able to make the pycharm downloading any packages (which just started randomly a few days ago, maybe after I tried to pip install a certain library)

1

There are 1 best solutions below

2
phd On

abc.update_abstractmethods() was added in Python 3.10. You're running Python 3.9 (guessed from the path "C:\Users\user_name\AppData\Local\Programs\Python\ Python39 \lib\site-packages\attr_make.py") so the method is not available.