{"id":7589,"library":"pymorphy3","title":"PyMorphy3","description":"PyMorphy3 is a morphological analyzer (POS tagger + inflection engine) for the Russian language. It provides tools for parsing words, getting normal forms, and inflecting words into various grammatical forms. The current version is 2.0.6, and the library is actively maintained with frequent minor releases to support new Python versions and address issues.","status":"active","version":"2.0.6","language":"en","source_language":"en","source_url":"https://github.com/no-plagiarism/pymorphy3","tags":["natural-language-processing","nlp","russian","morphology","pos-tagging","inflection"],"install":[{"cmd":"pip install pymorphy3 pymorphy3-dicts-ru","lang":"bash","label":"Standard Installation"},{"cmd":"pip install 'pymorphy3[fast]' pymorphy3-dicts-ru","lang":"bash","label":"Installation with C-extensions for performance (Python > 3.9)"}],"dependencies":[{"reason":"Essential dictionary package for Russian language analysis.","package":"pymorphy3-dicts-ru","optional":false},{"reason":"Required for command-line interface (CLI) tools.","package":"Click","optional":true}],"imports":[{"note":"The MorphAnalyzer class is now directly available at the top-level package for simplicity.","wrong":"from pymorphy3.analyzer import MorphAnalyzer","symbol":"MorphAnalyzer","correct":"from pymorphy3 import MorphAnalyzer"}],"quickstart":{"code":"import pymorphy3\n\nmorph = pymorphy3.MorphAnalyzer()\n\n# Parse a word\nword_analysis = morph.parse('стали')[0]\nprint(f\"Word: {word_analysis.word}\")\nprint(f\"Tag: {word_analysis.tag}\")\nprint(f\"Normal form: {word_analysis.normal_form}\")\n\n# Inflect a word to a different form\ninflected_word = word_analysis.inflect({'sing', 'datv'})\nif inflected_word:\n    print(f\"Inflected form (singular, dative): {inflected_word.word}\")\n","lang":"python","description":"Initializes the MorphAnalyzer and demonstrates parsing a word to get its grammatical tag and normal form, then inflecting it to a different case."},"warnings":[{"fix":"Upgrade your Python interpreter to 3.6 or higher, or pin `pymorphy3` to `<2.0.0`.","message":"Support for Python 2 and Python 3.5 was officially dropped in version 2.0.0. If you are using these Python versions, you must stick to `pymorphy3 < 2.0.0` or upgrade your Python environment.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Remove calls to `restore_word_case`. You may need to handle word casing manually or derive it from the `lexeme` property of a `Parse` object if applicable.","message":"The `restore_word_case` function was removed in version 2.0.5 due to cleanup and deprecation. Code relying on this function will fail.","severity":"breaking","affected_versions":">=2.0.5"},{"fix":"Install with `pip install 'pymorphy3[fast]' pymorphy3-dicts-ru` to enable C-extensions for faster processing on supported Python versions.","message":"For improved performance, especially with large texts, PyMorphy3 offers C-extension based 'fast' extras. These require Python 3.9+ and installing with `pymorphy3[fast]`.","severity":"gotcha","affected_versions":">=2.0.3"},{"fix":"Ensure `Click` is installed if you use the CLI tools: `pip install pymorphy3[cli]` (or `pip install Click`).","message":"The command-line interface (CLI) dependency was switched from `docopt` to `Click` in version 1.3.0, making `Click` an optional dependency. If you use `pymorphy3` from the command line, you might encounter issues if `Click` is not installed.","severity":"gotcha","affected_versions":">=1.3.0"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Update your code to remove any calls to `morph.restore_word_case()`.","cause":"The `restore_word_case` function was removed in PyMorphy3 version 2.0.5.","error":"AttributeError: 'MorphAnalyzer' object has no attribute 'restore_word_case'"},{"fix":"Install the dictionary package: `pip install pymorphy3-dicts-ru`.","cause":"The required Russian dictionary package `pymorphy3-dicts-ru` is not installed.","error":"NoDictionariesForLanguage: No dictionaries for language \"ru\" are installed. Run 'pip install pymorphy3-dicts-ru'."},{"fix":"Change your import statement from `from pymorphy3.analyzer import MorphAnalyzer` to `from pymorphy3 import MorphAnalyzer`.","cause":"You are using an old import path for `MorphAnalyzer`. It's now available directly under the `pymorphy3` package.","error":"ImportError: cannot import name 'MorphAnalyzer' from 'pymorphy3.analyzer' (C:\\...\\site-packages\\pymorphy3\\analyzer.py)"},{"fix":"Ensure `pymorphy3` is properly installed: `pip install pymorphy3 pymorphy3-dicts-ru`.","cause":"This error typically indicates that an underlying dependency for the data structures used by PyMorphy3 is missing, or the main `pymorphy3` package wasn't installed correctly.","error":"ModuleNotFoundError: No module named 'dawg'"}]}