ersilia-os / ersilia

The Ersilia Model Hub, a repository of AI/ML models for infectious and neglected disease research.
https://ersilia.io
GNU General Public License v3.0
219 stars 147 forks source link

šŸ› Bug: Unable to fetch with ersilia CLI: ModuleNotFoundError: No module named 'validators' #579

Closed DhanshreeA closed 1 year ago

DhanshreeA commented 1 year ago

Describe the bug.

I have an editable install of ersilia within the ersilia conda environment. I am at commit https://github.com/ersilia-os/ersilia/commit/77fb8c3dc8f2292647feb63e16fc0c6721bd3eab and this is the stack trace while running ersilia -v fetch

Traceback (most recent call last):
  File "/home/dee/miniconda3/envs/ersilia-env/bin/ersilia", line 33, in <module>
    sys.exit(load_entry_point('ersilia', 'console_scripts', 'ersilia')())
  File "/home/dee/miniconda3/envs/ersilia-env/bin/ersilia", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/home/dee/miniconda3/envs/ersilia-env/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/home/dee/miniconda3/envs/ersilia-env/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/dee/learn_xyz/outreachy/ersilia-project/ersilia/ersilia/__init__.py", line 36, in <module>
    from .core.modelbase import ModelBase
  File "/home/dee/learn_xyz/outreachy/ersilia-project/ersilia/ersilia/core/modelbase.py", line 5, in <module>
    from ..hub.content.slug import Slug
  File "/home/dee/learn_xyz/outreachy/ersilia-project/ersilia/ersilia/hub/content/slug.py", line 4, in <module>
    from .card import ModelCard
  File "/home/dee/learn_xyz/outreachy/ersilia-project/ersilia/ersilia/hub/content/card.py", line 9, in <module>
    import validators
ModuleNotFoundError: No module named 'validators'

Describe the steps to reproduce the behavior

  1. cd to ersilia repo and check if you are at the commit mentioned above, if not, pull from remote
  2. Activate the conda environment containing ersilia CLI
  3. Run ersilia -v fetch eosxxxx

Expected behavior.

No response

Screenshots.

No response

Operating environment

Ubuntu 22.04.1 LTS

Additional context

No response

DhanshreeA commented 1 year ago

@miquelduranfrigola @GemmaTuron

GemmaTuron commented 1 year ago

Have you tried first installing Ersilia again? We made changes to the installation due to the bentoML slimming, so it might be the validators package is not installed in your current ersilia version. Validators package is specified as a req in the setup.py file

Try a python -m pip install -e .in your ersilia env from the updated ersilia repo before fetching

DhanshreeA commented 1 year ago

Ah thanks for that @GemmaTuron I've installed ersilia again and while it does get installed, pip is flagging a dependency conflict. Have you run into this?

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
google-api-core 2.10.2 requires protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5, but you have protobuf 3.18.3 which is incompatible.
DhanshreeA commented 1 year ago

I see the progress bar in blue is new :grin:

GemmaTuron commented 1 year ago

No dependency conflicts on my side, @miquelduranfrigola ?

GemmaTuron commented 1 year ago

Hi @DhanshreeA !

Are you able to run Ersilia normally? Can we close this issue?

DhanshreeA commented 1 year ago

Hi @GemmaTuron yes it is working! Good to close the issue.