Install & Compatibility
Where this runs
tested against v2.4.417127.4579844 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.079s · 34.3MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.8s · import 0.076s · 35MB
32MB installed
● package 32MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MorphAnalyzer
✓ from pymorphy2 import MorphAnalyzer
The dictionaries are used by pymorphy2; direct import from pymorphy2_dicts_ru is not typical for analysis.
get_path
✓ import pymorphy2_dicts_ru; dict_path = pymorphy2_dicts_ru.get_path()
To explicitly get the installation path of the dictionary data.
Initialize `pymorphy2.MorphAnalyzer` with `lang='ru'` to use the Russian dictionaries. Then, use methods like `parse()` to analyze words and `inflect()` to change their grammatical form.
import pymorphy2
morph = pymorphy2.MorphAnalyzer(lang='ru')
word = 'корова'
parsed_word = morph.parse(word)[0]
print(f"Original word: {word}")
print(f"Normal form: {parsed_word.normal_form}")
print(f"Part of speech: {parsed_word.tag.POS}")
inflected_word = parsed_word.inflect({'gent', 'plur'})
if inflected_word:
print(f"Inflected (genitive plural): {inflected_word.word}")
word_unknown = 'бутявка'
parsed_unknown = morph.parse(word_unknown)[0]
print(f"\nUnknown word: {word_unknown}")
print(f"Normal form (heuristic): {parsed_unknown.normal_form}")
Debug
Known issues
breaking`pymorphy2` (which uses these dictionaries) dropped official support for Python 2.6, 3.2, 3.3, and 3.4 in version 0.9. Python 2.7 support was also marked for removal in future v1.0 releases. Ensure your environment uses a compatible Python version (3.5+ recommended).fixUpgrade to Python 3.5 or newer. If using Python 2.7, be aware that future `pymorphy2` versions may drop support.
affects: pymorphy2 < 0.9.x, pymorphy2-dicts-ru 2.4.x
gotchaWhen `pymorphy2` is installed after a Python process has started (e.g., within a Jupyter Notebook or Google Colab cell), it might fail to detect the installed dictionaries without restarting the kernel or process. This was a known issue in `pymorphy2` versions prior to 0.9.1.fixRestart your Python kernel or environment after installing `pymorphy2` and `pymorphy2-dicts-ru` to ensure correct dictionary loading.
affects: pymorphy2 < 0.9.1
gotchaThe OpenCorpora dictionaries used by `pymorphy2-dicts-ru` contain both correct and commonly used incorrect word forms. Therefore, methods like `word_is_known()` might return `True` for non-standard words, making it unsuitable for strict spell-checking without additional filtering.fixFor strict spell-checking, integrate an additional dictionary or apply custom filtering rules on the analysis results to distinguish between correct and commonly used incorrect forms.
affects: All versions
gotchaBy default, `pymorphy2.MorphAnalyzer` methods return `Parse` namedtuple objects. For performance-critical applications, especially in CPython, you can initialize `MorphAnalyzer` with `result_type=None` to receive plain tuples instead, which can be faster.fixInitialize `morph = pymorphy2.MorphAnalyzer(result_type=None)` for potentially faster processing at the cost of less descriptive return objects.
affects: All versions
Upgrade
Version history
2.4.417127.4579844latest on PyPI · released Oct 11, 2020
Audit
Dependencies
pymorphy2requiredThis package provides dictionary data for pymorphy2; pymorphy2 is required to perform morphological analysis using these dictionaries.