question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Bug descriptionmodel” 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'

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ptyneckicommented, Aug 22, 2022

@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).

1reaction
matteoferlacommented, Aug 22, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError using setup.py - Stack Overflow
And run jktool to execute my_function but I get the error: ModuleNotFoundError No module named 'jkt'. But when the app.py in jkt directory...
Read more >
Installing from source results in ModuleNotFoundError #41
There's currently a minor bug in setup.py - the required packages=['kitti2bag'] parameter is missing and causes normal installation to fail.
Read more >
ModuleNotFoundError: no module named Python Error [Fixed]
When you try to import a module in a Python file, Python tries to resolve this module in several ways. · As the...
Read more >
Install spaCy · spaCy Usage Documentation
spaCy is a free open-source library for Natural Language Processing in Python. It features NER, POS tagging, dependency parsing, word vectors and more....
Read more >
Sharing Code Using a setup.py File in Python
What are the Errors? ModuleNotFoundError: No module named 'common'. This error occurs when you are trying to import a Python package/module that is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found