Skip to content

Switch to importlib-metadata for compatibility with python >=3.12 #766

Open
@soredake

Description

More info here:
jjjake/internetarchive#621
jjjake/internetarchive#613

guessit does not work on python >=3.12 out of the box:

❯ guessit --help
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\user\AppData\Local\Programs\Python\Python312\Scripts\guessit.exe\[__main__.py](http://__main__.py/)", line 4, in <module>
File "C:\Users\user\AppData\Local\pipx\pipx\venvs\guessit\Lib\site-packages\guessit\[__init__.py](http://__init__.py/)", line 8, in <module>
from .api import guessit, GuessItApi
File "C:\Users\user\AppData\Local\pipx\pipx\venvs\guessit\Lib\site-packages\guessit\[api.py](http://api.py/)", line 17, in <module>
from .rules import rebulk_builder
File "C:\Users\user\AppData\Local\pipx\pipx\venvs\guessit\Lib\site-packages\guessit\rules\[__init__.py](http://__init__.py/)", line 11, in <module>
from .properties.episodes import episodes
File "C:\Users\user\AppData\Local\pipx\pipx\venvs\guessit\Lib\site-packages\guessit\rules\properties\[episodes.py](http://episodes.py/)", line 16, in <module>
from .title import TitleFromPosition
File "C:\Users\user\AppData\Local\pipx\pipx\venvs\guessit\Lib\site-packages\guessit\rules\properties\[title.py](http://title.py/)", line 11, in <module>
from .language import (
  File "C:\Users\user\AppData\Local\pipx\pipx\venvs\guessit\Lib\site-packages\guessit\rules\properties\[language.py](http://language.py/)", line 10, in <module>
  import babelfish
  File "C:\Users\user\AppData\Local\pipx\pipx\venvs\guessit\Lib\site-packages\babelfish\[__init__.py](http://__init__.py/)", line 14, in <module>
  from .converters import (LanguageConverter, LanguageReverseConverter, LanguageEquivalenceConverter, CountryConverter,
    File "C:\Users\user\AppData\Local\pipx\pipx\venvs\guessit\Lib\site-packages\babelfish\converters\[__init__.py](http://__init__.py/)", line 5, in <module>
    from pkg_resources import iter_entry_points, EntryPoint
    ModuleNotFoundError: No module named 'pkg_resources'

Workaround: pipx inject guessit setuptools

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions