Bug 40490 - ModuleNotFoundError: No module named 'unidecode'
Summary: ModuleNotFoundError: No module named 'unidecode'
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: python3-module-slugify (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Grigory Ustinov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-14 14:22 MSK by Vitaly Lipatov
Modified: 2023-02-08 16:38 MSK (History)
19 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaly Lipatov 2021-07-14 14:22:02 MSK
$ python3
> import slugify

  File "/usr/lib/python3/site-packages/slugify/slugify.py", line 17, in <module>
    import text_unidecode as unidecode
ModuleNotFoundError: No module named 'text_unidecode'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/opensnitch-ui", line 18, in <module>
    from opensnitch.service import UIService
  File "/usr/lib/python3/site-packages/opensnitch/service.py", line 19, in <module>
    from dialogs.prompt import PromptDialog
  File "/usr/lib/python3/site-packages/opensnitch/dialogs/prompt.py", line 10, in <module>
    from slugify import slugify
  File "/usr/lib/python3/site-packages/slugify/__init__.py", line 2, in <module>
    from .slugify import *
  File "/usr/lib/python3/site-packages/slugify/slugify.py", line 19, in <module>
    import unidecode
ModuleNotFoundError: No module named 'unidecode'

В модуле используется перебор для получения name2codepoint и unidecode . Нужно обеспечить наличие желаемого модуля добавлением зависимости в пакет.

Код перебора:
try:
    from htmlentitydefs import name2codepoint
    _unicode = unicode
    _unicode_type = types.UnicodeType
except ImportError:
    from html.entities import name2codepoint
    _unicode = str
    _unicode_type = str
    unichr = chr

try:
    import text_unidecode as unidecode
except ImportError:
    import unidecode
Comment 1 Grigory Ustinov 2023-02-08 16:38:44 MSK
* Fri Mar 11 2022 Stanislav Levin <slev@altlinux.org> 6.1.1-alt1
- 4.0.1 -> 6.1.1.