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

ModuleNotFoundError (pkg_resources) on import in 3.12 #145

Open
jsstevenson opened this issue Apr 16, 2024 · 0 comments
Open

ModuleNotFoundError (pkg_resources) on import in 3.12 #145

jsstevenson opened this issue Apr 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jsstevenson
Copy link
Contributor

Describe the bug
Same issue as biocommons/eutils#173: Importing raises a ModuleNotFoundError:

>>> import biocommons.seqrepo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jss009/code/mavemap/tmp-venv/lib/python3.12/site-packages/biocommons/seqrepo/__init__.py", line 5, in <module>
    from .seqrepo import SeqRepo  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jss009/code/mavemap/tmp-venv/lib/python3.12/site-packages/biocommons/seqrepo/seqrepo.py", line 11, in <module>
    from .fastadir import FastaDir
  File "/Users/jss009/code/mavemap/tmp-venv/lib/python3.12/site-packages/biocommons/seqrepo/fastadir/__init__.py", line 1, in <module>
    from .fastadir import FastaDir
  File "/Users/jss009/code/mavemap/tmp-venv/lib/python3.12/site-packages/biocommons/seqrepo/fastadir/fastadir.py", line 11, in <module>
    import yoyo
  File "/Users/jss009/code/mavemap/tmp-venv/lib/python3.12/site-packages/yoyo/__init__.py", line 27, in <module>
    from yoyo.connections import get_backend
  File "/Users/jss009/code/mavemap/tmp-venv/lib/python3.12/site-packages/yoyo/connections.py", line 23, in <module>
    from yoyo.backends import get_backend_class
  File "/Users/jss009/code/mavemap/tmp-venv/lib/python3.12/site-packages/yoyo/backends/__init__.py", line 1, in <module>
    from yoyo.backends.base import DatabaseBackend
  File "/Users/jss009/code/mavemap/tmp-venv/lib/python3.12/site-packages/yoyo/backends/base.py", line 32, in <module>
    from yoyo import internalmigrations
  File "/Users/jss009/code/mavemap/tmp-venv/lib/python3.12/site-packages/yoyo/internalmigrations/__init__.py", line 8, in <module>
    from . import v2
  File "/Users/jss009/code/mavemap/tmp-venv/lib/python3.12/site-packages/yoyo/internalmigrations/v2.py", line 7, in <module>
    from yoyo.migrations import get_migration_hash
  File "/Users/jss009/code/mavemap/tmp-venv/lib/python3.12/site-packages/yoyo/migrations.py", line 34, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

To Reproduce
Import biocommons.seqrepo or anything contained therein

Additional context
If memory serves, importlib.metadata is the drop-in fix, but it's also worth asking if this version check is needed.

Users can get around this for now by also pinning a newer version of setuptools (eg 68) in addition to biocommons.seqrepo in their project dependencies

@jsstevenson jsstevenson added the bug Something isn't working label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant