Не работает с Python 3.11
Из-за удаления метода inspect.getargspec. Нужно заменить вызов на getfullargspec. Решение тут: #157
analyzer = MorphAnalyzer(lang="uk")
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pymorphy2/analyzer.py", line 224, in __init__
self._init_units(units)
File "/usr/lib/python3.11/site-packages/pymorphy2/analyzer.py", line 235, in _init_units
self._units.append((self._bound_unit(unit), False))
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pymorphy2/analyzer.py", line 246, in _bound_unit
unit = unit.clone()
^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pymorphy2/units/base.py", line 35, in clone
return self.__class__(**self._get_params())
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pymorphy2/units/base.py", line 76, in _get_params
(key, getattr(self, key, None)) for key in self._get_param_names()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pymorphy2/units/base.py", line 70, in _get_param_names
args, varargs, kw, default = inspect.getargspec(cls.__init__)
^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?
https://github.com/pymorphy2/pymorphy2/pull/162
Многоуважаемые люди из интернета сделали форк, который пока что работает как временное решение: https://github.com/no-plagiarism/pymorphy3
There is also https://github.com/pymorphy2-fork, they have an updated version of the underlying DAWG library, so that you can use the "fast" extra on newer Pythons.
https://github.com/pymorphy2/pymorphy2/pull/173
patch /usr/lib/python3.12/site-packages/pymorphy2/units/base.py < patch
--- /usr/lib/python3.12/site-packages/pymorphy2/units/base.py 2024-06-11 00:25:00.495794626 +0300
+++ /usr/lib/python3.11/site-packages/pymorphy2/units/base.py 2023-05-17 20:07:20.322965962 +0300
@@ -67,7 +67,7 @@
"""
if cls.__init__ is object.__init__:
return []
- args, varargs, kw, default = inspect.getargspec(cls.__init__)
+ args, *_ = inspect.getfullargspec(cls.__init__)
return sorted(args[1:])
def _get_params(self):
@doctorcolossus actually, you've already posted your solution here, but the pull request for the issue exists for a long time, it is #161. A lot of similar pull requests don't fix the main problem: the project is abandoned.