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
unable to import esm #257
Comments
@pengzhangzhi Reinstall the package from main branch. |
Yes it sounds like a version conflict. Can you |
Seems like the version I install is just 1.0.2. I just install the pkg and find this error. After uninstall and re-install with ---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Untitled-1.ipynb Cell 1 in <cell line: 2>()
[1](vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#W0sdW50aXRsZWQ%3D?line=0) import torch
----> [2](vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#W0sdW50aXRsZWQ%3D?line=1) import esm
[4](vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#W0sdW50aXRsZWQ%3D?line=3) # Load ESM-2 model
[5](vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#W0sdW50aXRsZWQ%3D?line=4) model, alphabet = esm.pretrained.esm2_t48_15B_UR50D()
File ~/anaconda3/envs/torch/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.esm1'; 'esm.model' is not a package |
I also have this problem, installing from main and also from pypi with Error messageIn [1]: import torch
In [2]: import esm
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Input In [2], in <cell line: 1>()
----> 1 import esm
File ~/mambaforge/envs/fairesm/lib/python3.9/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.esm1'; 'esm.model' is not a package EnvironmentThe result of
conda list
# Name Version Build Channel
_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 2_gnu conda-forge
asttokens 2.0.8 pypi_0 pypi
backcall 0.2.0 pypi_0 pypi
bzip2 1.0.8 h7f98852_4 conda-forge
ca-certificates 2022.6.15 ha878542_0 conda-forge
debugpy 1.6.3 pypi_0 pypi
decorator 5.1.1 pypi_0 pypi
entrypoints 0.4 pypi_0 pypi
executing 0.10.0 pypi_0 pypi
fair-esm 1.0.2 pypi_0 pypi
ipykernel 6.15.1 pypi_0 pypi
ipython 8.4.0 pypi_0 pypi
jedi 0.18.1 pypi_0 pypi
jupyter-client 7.3.4 pypi_0 pypi
jupyter-core 4.11.1 pypi_0 pypi
ld_impl_linux-64 2.36.1 hea4e1c9_2 conda-forge
libffi 3.4.2 h7f98852_5 conda-forge
libgcc-ng 12.1.0 h8d9b700_16 conda-forge
libgomp 12.1.0 h8d9b700_16 conda-forge
libnsl 2.0.0 h7f98852_0 conda-forge
libsqlite 3.39.2 h753d276_1 conda-forge
libuuid 2.32.1 h7f98852_1000 conda-forge
libzlib 1.2.12 h166bdaf_2 conda-forge
matplotlib-inline 0.1.6 pypi_0 pypi
ncurses 6.3 h27087fc_1 conda-forge
nest-asyncio 1.5.5 pypi_0 pypi
openssl 3.0.5 h166bdaf_1 conda-forge
packaging 21.3 pypi_0 pypi
parso 0.8.3 pypi_0 pypi
pexpect 4.8.0 pypi_0 pypi
pickleshare 0.7.5 pypi_0 pypi
pip 22.2.2 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.30 pypi_0 pypi
psutil 5.9.1 pypi_0 pypi
ptyprocess 0.7.0 pypi_0 pypi
pure-eval 0.2.2 pypi_0 pypi
pygments 2.13.0 pypi_0 pypi
pyparsing 3.0.9 pypi_0 pypi
python 3.9.13 h2660328_0_cpython conda-forge
python-dateutil 2.8.2 pypi_0 pypi
python_abi 3.9 2_cp39 conda-forge
pyzmq 23.2.1 pypi_0 pypi
readline 8.1.2 h0f457ee_0 conda-forge
setuptools 65.2.0 py39hf3d152e_0 conda-forge
six 1.16.0 pypi_0 pypi
sqlite 3.39.2 h4ff8645_1 conda-forge
stack-data 0.4.0 pypi_0 pypi
tk 8.6.12 h27826a3_0 conda-forge
torch 1.12.1 pypi_0 pypi
tornado 6.2 pypi_0 pypi
traitlets 5.3.0 pypi_0 pypi
typing-extensions 4.3.0 pypi_0 pypi
tzdata 2022c h191b570_0 conda-forge
wcwidth 0.2.5 pypi_0 pypi
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
xz 5.2.6 h166bdaf_0 conda-forge |
I also have a similar problem when I try to run the extract.py script File "/home/dikshyant/anaconda3/lib/python3.7/site-packages/esm/init.py", line 9, in |
I had this issue too, but I could run it with a trick.
after that if you are using Jupyter (like colab), first run this block of code, to download the model completely:
after several minutes you can run rest of your code. |
Hi folks thanks for flagging this issue. The build was broken due to an old file ( The wheel is fixed now, so please go ahead and pip uninstall, then Sorry for the inconvenience. |
Problem solved! Happy to see that! |
I install by
pip install fair-esm
.Then try the example code:
The following error is raised:
The text was updated successfully, but these errors were encountered: