GROMACS version:
GROMACS modification: Yes/No
Hello everyone, while doing protein ligand complex-ligand topology building step I am getting output stating that cannot import name 'gcd:. I am using python 3.10.6 with script cgenff_charmm2gmx_py3_nx2.py with networkx-2.3 and I am getting the below output:
/gromacs/test1$ python3 cgenff_charmm2gmx.py UNK unk_fix.mol2 unk.str charmm36-jul2021.ff
Traceback (most recent call last):
File “/mnt/c/users/admin/desktop/gromacs/test1/cgenff_charmm2gmx.py”, line 54, in
import networkx as nx
File “/home/shanu/.local/lib/python3.10/site-packages/networkx/init.py”, line 114, in
import networkx.generators
File “/home/shanu/.local/lib/python3.10/site-packages/networkx/generators/init.py”, line 14, in
from networkx.generators.intersection import *
File “/home/shanu/.local/lib/python3.10/site-packages/networkx/generators/intersection.py”, line 13, in
from networkx.algorithms import bipartite
File “/home/shanu/.local/lib/python3.10/site-packages/networkx/algorithms/init.py”, line 16, in
from networkx.algorithms.dag import *
File “/home/shanu/.local/lib/python3.10/site-packages/networkx/algorithms/dag.py”, line 23, in
from fractions import gcd
ImportError: cannot import name ‘gcd’ from ‘fractions’ (/usr/lib/python3.10/fractions.py)
Also, when I changed the networkx 2.5, I am getting below output:
/gromacs/test1$ python3 cgenff_charmm2gmx.py UNK unk_fix.mol2 unk.str charmm36-jul2021.ff
This script has been tested with NetworkX 2.3, and 2.4 is buggy.
Please install version 2.3 for best performance:
pip uninstall networkx
pip install networkx==2.3
NOTE 1: Code tested with Python 3.5.2 and 3.7.3. Your version: 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]
NOTE 2: Code tested with NetworkX 2.3. Your version: 2.5
NOTE 3: Please be sure to use the same version of CGenFF in your simulations that was used during parameter generation:
–Version of CGenFF detected in unk.str : 4.6
–Version of CGenFF detected in charmm36-jul2021.ff/forcefield.doc : 4.6
NOTE 4: To avoid duplicated parameters, do NOT select the ‘Include parameters that are already in CGenFF’ option when uploading a molecule into CGenFF.
Traceback (most recent call last):
File “/mnt/c/users/admin/desktop/gromacs/test1/cgenff_charmm2gmx.py”, line 1044, in
m.read_mol2_coor_only(mol2_name)
File “/mnt/c/users/admin/desktop/gromacs/test1/cgenff_charmm2gmx.py”, line 904, in read_mol2_coor_only
self.G.node[atomi][‘x’] = float(entry[2])
AttributeError: ‘Graph’ object has no attribute ‘node’. Did you mean: ‘_node’?
Please help me out with that.
Thank you