NameError: name 'load' is not defined after importing spyrmsd

Question:

I’m running a python code where I’m importing the python module sPyRMSD. I’m getting an error when I reach the line containing the io.loadmol() for loading molecules.

from spyrmsd import io,rmsd
ref = io.loadmol("tempref.pdb")

I’m getting the following error-

Reference Molecule:lig_ref.pdb
PDBqt File:ligand_vina_out.pdbqt
Traceback (most recent call last):
File "rmsd.py", line 34, in <module>
ref = io.loadmol("tempref.pdb")
File "/home/aathiranair/.local/lib/python3.8/site- 
packages/spyrmsd/io.py", line 66, in loadmol
mol = load(fname)
NameError: name 'load' is not defined

I tried uninstalling and reinstalling the spyrmsd module, but I still face the same issue.
I also tried creating a virtual environment and running the script but faced the same issue.

(ihub_proj) aathiranair@aathiranair-Inspiron-5406- 
2n1:~/Desktop/Ihub$ python3 rmsd.py lig_ref.pdb 
ligand_vina_out.pdbqt 
Reference Molecule:lig_ref.pdb
PDBqt File:ligand_vina_out.pdbqt
Traceback (most recent call last):
File "rmsd.py", line 34, in <module>
ref = io.loadmol("tempref.pdb")
File 
"/home/aathiranair/Desktop/Ihub/ihub_proj/lib/python3.8/site- 
packages/spyrmsd/io.py", line 66, in loadmol
mol = load(fname)
NameError: name 'load' is not defined

the tempref.pdb file looks like this-

ATOM      1  O6  LIG   359       2.349   1.014   7.089  0.00  0.00              
ATOM      9  H   LIG   359       1.306   1.691   9.381  0.00  0.00              
ATOM      2  C2  LIG   359       0.029   4.120   8.082  0.00  0.00              
ATOM      3  O9  LIG   359      -1.106   2.491   9.345  0.00  0.00              
ATOM      4  C1  LIG   359      -0.204   3.890   0.337  0.00  0.00              
ATOM      5  S5  LIG   359      -0.355   4.108   4.075  0.00  0.00              
ATOM      8  C4  LIG   359      -3.545   1.329   7.893  0.00  0.00              
ATOM      7  C7  LIG   359      -1.133   5.150   9.406  0.00  0.00              
ATOM      6  C3  LIG   359      -0.064   1.805   8.234  0.00  0.00    
Asked By: Aathira Nair

||

Answers:

It seems that to use the module io one of OpenBabel or RDKit is required

Also, make sure to have NumPy

Answered By: Pignotto
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.