Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing dependency on setuptools #1

Open
vincentbernat opened this issue Nov 13, 2022 · 1 comment
Open

Missing dependency on setuptools #1

vincentbernat opened this issue Nov 13, 2022 · 1 comment

Comments

@vincentbernat
Copy link

Hey!

    language_name = reduced.language_name(language, max_distance)
  File "/nix/store/slc2gq45p8rm5fl1vc7phwlfa8jyqql6-python3-3.10.8-env/lib/python3.10/site-packages/langcodes/__init__.py", line 942, in language_name
    return self._get_name('language', language, max_distance)
  File "/nix/store/slc2gq45p8rm5fl1vc7phwlfa8jyqql6-python3-3.10.8-env/lib/python3.10/site-packages/langcodes/__init__.py", line 853, in _get_name
    from language_data.names import code_to_names
  File "/nix/store/slc2gq45p8rm5fl1vc7phwlfa8jyqql6-python3-3.10.8-env/lib/python3.10/site-packages/language_data/names.py", line 4, in <module>
    from language_data.util import data_filename
  File "/nix/store/slc2gq45p8rm5fl1vc7phwlfa8jyqql6-python3-3.10.8-env/lib/python3.10/site-packages/language_data/util.py", line 5, in <module>
    from pkg_resources import resource_filename
ModuleNotFoundError: No module named 'pkg_resources'

setuptools should be declared as a dependency to get pkg_resources. I am not familiar enough with Poetry to know where this should be specified.

@latk
Copy link

latk commented Oct 5, 2023

In any case, the use of setuptools seems to be deprecated. I got the following warning that originated in this library:

DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    from pkg_resources import resource_filename

Instead, the standard library importlib.resources.files() function seems to be state of the art (for Python 3.9+).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants