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

🐛[BUG]: import modulus throws error: No module named 'importlib_metadata' #336

Open
saydemr opened this issue Feb 8, 2024 · 2 comments
Labels
? - Needs Triage Need team to review and classify bug Something isn't working

Comments

@saydemr
Copy link
Contributor

saydemr commented Feb 8, 2024

Version

0.5.0

On which installation method(s) does this occur?

Pip

Describe the issue

Upon installing modulus with pip, importing the library throws import error because importlib_metadata is not included in the dependencies for base and dev install.

Import error is thrown due to this line in the code.

Minimum reproducible example

pip install nvidia-modulus[dev]
python
>>> import modulus

Relevant log output

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/<username>/anaconda3/envs/mod/lib/python3.10/site-packages/modulus/__init__.py", line 17, in <module>
    from .models.meta import ModelMetaData
  File "/home/<username>/anaconda3/envs/mod/lib/python3.10/site-packages/modulus/models/__init__.py", line 15, in <module>
    from .module import Module
  File "/home/<username>/anaconda3/envs/mod/lib/python3.10/site-packages/modulus/models/module.py", line 29, in <module>
    from modulus.registry import ModelRegistry
  File "/home/<username>/anaconda3/envs/mod/lib/python3.10/site-packages/modulus/registry/__init__.py", line 15, in <module>
    from .model_registry import ModelRegistry
  File "/home/<username>/anaconda3/envs/mod/lib/python3.10/site-packages/modulus/registry/model_registry.py", line 19, in <module>
    import importlib_metadata
ModuleNotFoundError: No module named 'importlib_metadata'

Environment details

+ Environment location: Bare-metal
+ Python : 3.10.13
+ pip : 23.3.1
@saydemr saydemr added ? - Needs Triage Need team to review and classify bug Something isn't working labels Feb 8, 2024
@N-Masi
Copy link

N-Masi commented Nov 5, 2024

For anyone else facing this issue, if it's not obvious, the solution is to run pip install importlib-metadata in your environment. Other dependencies not installed in the same overlooked way are the requests and warp-lang modules.

@peterdsharpe
Copy link
Collaborator

peterdsharpe commented Nov 21, 2024

Reproducing here as well, as recently as Modulus version 0.9.0a0 (latest at time of wriing). Maintaining a full list of missing dependencies I've encountered:


During import and modulus.__version__ call:

  • importlib_metadata

During pytest:

  • warp
  • wandb
  • dgl
  • omegaconf
  • vtk
  • h5py
  • pyvista
  • einops
  • termcolor
  • hydra
  • transformer_engine
  • cftime
  • stl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
? - Needs Triage Need team to review and classify bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants