oxpig / ANARCI

Antibody Numbering and Antigen Receptor ClassIfication
BSD 3-Clause "New" or "Revised" License
189 stars 92 forks source link

ModuleNotFoundError: No module named 'anarci.germlines' #62

Closed elihabash23 closed 1 year ago

elihabash23 commented 1 year ago

Hello,

It seems that the deletion of the germlines.py file causes an issue with anarci and makes it unusable as this file is still imported?

# Import the anarci function.
from anarci import anarci

ModuleNotFoundError Traceback (most recent call last)

in () 1 # Import the anarci function. 2 # import anarci ----> 3 from anarci import anarci /data/dataiku/dss_data/code-envs/python/py39-opencv/lib/python3.9/site-packages/anarci/__init__.py in 1 __version__ = "1.b" 2 __all__ = ["anarci", "schemes"] ----> 3 from .anarci import * /data/dataiku/dss_data/code-envs/python/py39-opencv/lib/python3.9/site-packages/anarci/anarci.py in 66 # Import from the schemes submodule 67 from .schemes import * ---> 68 from .germlines import all_germlines 69 70 all_species = list(all_germlines['V']['H'].keys()) ModuleNotFoundError: No module named 'anarci.germlines'
broncio123 commented 1 year ago

The right way to get all germalines is

import anarci
all_germlines = anarci.all_germlines
SHEN-Cheng commented 1 year ago

I got the same issue when import the anarc1

``

ModuleNotFoundError Traceback (most recent call last) Cell In[4], line 1 ----> 1 import anarci 2 all_germlines = anarci.all_germlines

File ~\AppData\Roaming\Python\Python311\site-packages\anarci__init.py:3 1 version = "1.b" 2 all__ = ["anarci", "schemes"] ----> 3 from .anarci import *

File ~\AppData\Roaming\Python\Python311\site-packages\anarci\anarci.py:61 59 # Import from the schemes submodule 60 from .schemes import * ---> 61 from .germlines import all_germlines 63 all_species = list(all_germlines['V']['H'].keys()) 65 amino_acids = sorted(list("QWERTYIPASDFGHKLCVNM"))

ModuleNotFoundError: No module named 'anarci.germlines `

wertick01 commented 5 months ago

The problem is most likely that when you run the installation using the command

python setup.py install

due to the lack of power in the Republic of ANARCI, some of them are not installed (including germlines.py)

Granting access rights to the current user helped me:

sudo chown -R$USER:$USER ANARCI && sudo chmod -R u+rwx ANARCI

in more detail:

git clone of a scoundrel https://github.com/oxpig/ANARCI.git

# add the permission to the ANARCI directory (without it you will have an error with the "germlines" module)
sudo chown -R $USER:$USER ANARCI && sudo chmod -R u+rwx ANARCI
cd ANARCI
python3 setup.py install