Ligand preparation code error

GROMACS version: 2021.4-Ubuntu-2021.4-2
GROMACS modification: Yes/No
Here post your question
when i enter this code to create ligand topology files it shows an error. I have networkx version 2.3, python 3.10.6. can anyone help me to fix this issue?

entered code:

python3 cgenff_charmm2gmx_cp.py JZ4 jz4_fix.mol2 jz4.str charmm36-jul2021.ff"

Error found:

Traceback (most recent call last):
File “/media/omar/Secondary/MDs/test/cgenff_charmm2gmx_cp.py”, line 54, in
import networkx as nx
File “/usr/local/lib/python3.10/dist-packages/networkx/init.py”, line 114, in
import networkx.generators
File “/usr/local/lib/python3.10/dist-packages/networkx/generators/init.py”, line 14, in
from networkx.generators.intersection import *
File “/usr/local/lib/python3.10/dist-packages/networkx/generators/intersection.py”, line 13, in
from networkx.algorithms import bipartite
File “/usr/local/lib/python3.10/dist-packages/networkx/algorithms/init.py”, line 16, in
from networkx.algorithms.dag import *
File “/usr/local/lib/python3.10/dist-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)

Some syntax has changed between Python versions. Use an older Python version (e.g. 3.7.x).

Thank you so much for your time, but i have python 3.10.6 default in my ubuntu 22.04 LTS, can you explain how can i use 3.7 instead of 3.10.6? or run the script in 3.10.6? This will be so helpful for me,

Are you familiar with installing packages using conda? Or using conda to setup an environment with specific versions of a package? (Managing environments — conda 23.7.2.dev9 documentation)

not that much, but i have conda installed in my system, i’ll try to do this and get an updt