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

Installing SCDL raises a missing dependency #472

Open
edawson opened this issue Nov 23, 2024 · 0 comments
Open

Installing SCDL raises a missing dependency #472

edawson opened this issue Nov 23, 2024 · 0 comments

Comments

@edawson
Copy link
Collaborator

edawson commented Nov 23, 2024

When installing SCDL for local development purposes, there is a missing dependency:

git clone https://github.com/nvidia/bionemo-framework.git

cd bionemo-framework/sub-packages/bionemo-scdl

pip install -e .

Running the above raises the following:

Traceback (most recent call last):
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/networks.py", line 865, in import_email_validator
    import email_validator
ModuleNotFoundError: No module named 'email_validator'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/edawson/nv/bionemo-framework/sub-packages/bionemo-scdl/src/bionemo/scdl/scripts/convert_multiread.py", line 3, in <module>
    from bionemo.core.data.load import load
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/bionemo/core/data/load.py", line 33, in <module>
    from bionemo.core.data.resource import Resource, get_all_resources
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/bionemo/core/data/resource.py", line 39, in <module>
    class Resource(pydantic.BaseModel):
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 226, in __new__
    complete_model_class(
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 658, in complete_model_class
    schema = cls.__get_pydantic_core_schema__(cls, handler)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/main.py", line 702, in __get_pydantic_core_schema__
    return handler(source)
           ^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 84, in __call__
    schema = self._handler(source_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 612, in generate_schema
    schema = self._generate_schema_inner(obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 881, in _generate_schema_inner
    return self._model_schema(obj)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 693, in _model_schema
    {k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 693, in <dictcomp>
    {k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1073, in _generate_md_field_schema
    common_field = self._common_field_schema(name, field_info, decorators)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1261, in _common_field_schema
    schema = self._apply_annotations(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2061, in _apply_annotations
    schema = get_inner_schema(source_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 84, in __call__
    schema = self._handler(source_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2040, in inner_handler
    from_property = self._generate_schema_from_property(obj, source_type)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 761, in _generate_schema_from_property
    schema = get_schema(
             ^^^^^^^^^^^
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/networks.py", line 980, in __get_pydantic_core_schema__
    import_email_validator()
  File "/home/edawson/miniconda3/envs/scdl/lib/python3.11/site-packages/pydantic/networks.py", line 867, in import_email_validator
    raise ImportError('email-validator is not installed, run `pip install pydantic[email]`') from e
ImportError: email-validator is not installed, run `pip install pydantic[email]`

Installing pydantic[email] fixes the issue. However, we shouldn't need the email parser is my assumption.

In addition, SCDL now has a dependency on bionemo-core, meaning it requires all of that package's dependencies. Is there a way to minimize the dependency surface so that users could easily install standalone SCDL without having to install all of bionemo-core, torch, nccl, etc?

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