# Error in python3 cgenff\_charmm2gmx\_py3\_nx2.py ligand ligand\_fix.mol2 ligand.str charmm36-jul2022.ff

**URL:** <https://gromacs.bioexcel.eu/t/error-in-python3-cgenff-charmm2gmx-py3-nx2-py-ligand-ligand-fix-mol2-ligand-str-charmm36-jul2022-ff/6984>\
**Category:** User discussions\
**Tags:** forcefield\
**Created:** [August 8, 2023, 7:18am UTC](https://gromacs.bioexcel.eu/t/error-in-python3-cgenff-charmm2gmx-py3-nx2-py-ligand-ligand-fix-mol2-ligand-str-charmm36-jul2022-ff/6984 "2023-08-08T07:18:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anshika\_Gupta](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Anshika\_Gupta](https://gromacs.bioexcel.eu/u/Anshika_Gupta)\
**Post date:** [August 8, 2023, 7:18am UTC](https://gromacs.bioexcel.eu/t/error-in-python3-cgenff-charmm2gmx-py3-nx2-py-ligand-ligand-fix-mol2-ligand-str-charmm36-jul2022-ff/6984/1 "2023-08-08T07:18:42Z")

</div>

After giving this command (python3 cgenff\_charmm2gmx\_py3\_nx2.py ligand ligand\_fix.mol2 ligand.str charmm36-jul2022.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.8.10 (default, May 26 2023, 14:05:08)  
[GCC 9.4.0]

NOTE 2: Code tested with NetworkX 2.3. Your version: 3.1

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 charmm36-jul2022.ff/forcefield.doc : 4.6

WARNING: CGenFF versions are not equivalent!

ERROR: Could not detect CGenFF version. Exiting.

and when I’m trying this pip uninstall networkx  
pip install networkx==2.3  
I’m facing this issue  
Traceback (most recent call last):  
File “cgenff\_charmm2gmx\_py3\_nx2.py”, line 54, in   
import networkx as nx  
File “/usr/local/lib/python3.8/dist-packages/networkx/_init_.py”, line 117, in   
import networkx.readwrite  
File “/usr/local/lib/python3.8/dist-packages/networkx/readwrite/_init_.py”, line 15, in   
from networkx.readwrite.graphml import \*  
File “/usr/local/lib/python3.8/dist-packages/networkx/readwrite/graphml.py”, line 314, in   
class GraphML(object):  
File “/usr/local/lib/python3.8/dist-packages/networkx/readwrite/graphml.py”, line 346, in GraphML  
(np.int, “int”), (np.int8, “int”),  
File “/usr/local/lib/python3.8/dist-packages/numpy/\_init.py”, line 305, in \__getattr_  
raise AttributeError(_former\_attrs_[attr])  
AttributeError: module ‘numpy’ has no attribute ‘int’.  
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.  
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:  
[NumPy 1.20.0 Release Notes — NumPy v2.0.dev0 Manual](https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations) …  
Kindly tell how to rectify this error!!!

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [August 8, 2023, 2:01pm UTC](https://gromacs.bioexcel.eu/t/error-in-python3-cgenff-charmm2gmx-py3-nx2-py-ligand-ligand-fix-mol2-ligand-str-charmm36-jul2022-ff/6984/2 "2023-08-08T14:01:36Z")

</div>

The conversion script expects a particular statement in the header of the stream file that is written by the CGenFF program/server. Yours doesn’t have it, meaning you either generated the stream file with a different program or you edited it and shouldn’t have.

---

<div class="post-metadata">

**Author:** ![Anshika\_Gupta](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Anshika\_Gupta](https://gromacs.bioexcel.eu/u/Anshika_Gupta)\
**Post date:** [August 9, 2023, 10:22am UTC](https://gromacs.bioexcel.eu/t/error-in-python3-cgenff-charmm2gmx-py3-nx2-py-ligand-ligand-fix-mol2-ligand-str-charmm36-jul2022-ff/6984/3 "2023-08-09T10:22:32Z")

</div>

Thank you so much sir for your reply!!

---

<div class="post-metadata">

**Author:** ![Nishant](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nishant](https://gromacs.bioexcel.eu/u/Nishant)\
**Post date:** [September 25, 2023, 5:30am UTC](https://gromacs.bioexcel.eu/t/error-in-python3-cgenff-charmm2gmx-py3-nx2-py-ligand-ligand-fix-mol2-ligand-str-charmm36-jul2022-ff/6984/4 "2023-09-25T05:30:55Z")

</div>

Hi, Anshika  
I’m also facing the same issue, could you please help me out in solving the issue?
