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 - "model" directory is missed in setup.py #253

Closed
ptynecki opened this issue Aug 22, 2022 · 7 comments
Closed

ModuleNotFoundError - "model" directory is missed in setup.py #253

ptynecki opened this issue Aug 22, 2022 · 7 comments
Assignees

Comments

@ptynecki
Copy link

ptynecki commented Aug 22, 2022

Bug description
"model" directory is missed in "packages" argument in setup.py script. That issue raised ModuleNotFoundError: No module named 'esm.model' exception.

Reproduction steps
Try to install esm package from PyPI or from the GitHub repository.

Expected behavior
I was expected successful installation.

Logs

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [1], in <cell line: 2>()
      1 import torch
----> 2 import esm

File ~/protein_embeddings/env/lib/python3.8/site-packages/esm/__init__.py:9, in <module>
      6 from .version import version as __version__  # noqa
      8 from .data import Alphabet, BatchConverter, FastaBatchedDataset  # noqa
----> 9 from .model.esm1 import ProteinBertModel  # noqa
     10 from .model.esm2 import ESM2  # noqa
     11 from .model.msa_transformer import MSATransformer  #noqa

ModuleNotFoundError: No module named 'esm.model'
@brycejoh16
Copy link

brycejoh16 commented Aug 22, 2022

having the same issue right now looking for a solution. (i am not on ESM team)

@ptynecki
Copy link
Author

@brycejoh16

PR is waiting:
#254

@brycejoh16
Copy link

@ptynecki thank you!

@ptynecki
Copy link
Author

@tomsercu PR #254 is resolving the issue problem but there is another during the installation.

The fairscale package is required (not added to setup.py as well).

@nikitos9000
Copy link
Contributor

Hi @ptynecki @brycejoh16 thanks for spotting that! It's fixed now in #254, the fairscale dependency will be fixed soon.

@matteoferla
Copy link

I might be wrong, but the setup.py is rather curiously written, I don't know your guys setup and I have not looked at the history, but it very much looks like be a case of files being erroneously switched for a test or similar.
Say

  • the setuptools.setup function lacks a requirement argument (i.e. no fairscale module))
  • setuptools.find_packages fills subpackages without issues (okay, PyCharm does it but is bad)
  • reading files in the setup.py file is bad and may raise a FileNotFoundError if packaged as a wheel without the Manifest.in file
  • __version__ is read very oddly
  • etc.

So might be worth checking there's no weird accident in the version!

@nikitos9000 nikitos9000 self-assigned this Aug 23, 2022
@tomsercu
Copy link
Contributor

Thanks yes much about our build/release process could be improved.
#256 addressed the fairscale dependency.
@ptynecki let us know if your issues are resolved now. Thanks all for your input!

@tomsercu tomsercu closed this as completed Sep 9, 2022
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

5 participants