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

Failure of submitit 1.5.1 with python 3.12 because of missing pkg_resources #1765

Open
GianlucaFicarelli opened this issue May 21, 2024 · 0 comments

Comments

@GianlucaFicarelli
Copy link

From https://setuptools.pypa.io/en/latest/pkg_resources.html

Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports

In python 3.12, setuptools isn't installed automatically, so pkg_resources might not be available, and submitit will fail.
For example, in a clean python 3.12 venv (without setuptools installed):

❯ pip list
Package           Version
----------------- -------
cloudpickle       3.0.0
pip               24.0
submitit          1.5.1
typing_extensions 4.11.0
>>> from submitit.core.plugins import get_executors
>>> get_executors()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/private/tmp/venv/lib/python3.12/site-packages/submitit/core/plugins.py", line 65, in get_executors
    return {ex.name(): ex for ex in _get_plugins()[0]}
                                    ^^^^^^^^^^^^^^
  File "/private/tmp/venv/lib/python3.12/site-packages/submitit/core/plugins.py", line 24, in _get_plugins
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

Needed fix: pkg_resources should be replaced by importlib.
In the meantime, a temporary workaround is to explicitly install setuptools

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

1 participant