You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ImportError: cannot import name 'gcd' from 'fractions' (C:\PROGRA1\QGIS321.13\apps\Python39\lib\fractions.py)
Traceback (most recent call last):
File "C:\PROGRA1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 423, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation_init.py", line 37, in classFactory
from .BoundaryDelineation import BoundaryDelineation
File "C:\PROGRA1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation\BoundaryDelineation.py", line 48, in
import networkx as nx
File "C:\PROGRA1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation/lib\networkx_init.py", line 114, in
import networkx.generators
File "C:\PROGRA1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation/lib\networkx\generators_init.py", line 14, in
from networkx.generators.intersection import *
File "C:\PROGRA1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation/lib\networkx\generators\intersection.py", line 13, in
from networkx.algorithms import bipartite
File "C:\PROGRA1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation/lib\networkx\algorithms_init.py", line 16, in
from networkx.algorithms.dag import *
File "C:\PROGRA1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation/lib\networkx\algorithms\dag.py", line 23, in
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (C:\PROGRA1\QGIS321.13\apps\Python39\lib\fractions.py)
Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
QGIS version: 3.28.13-Firenze Firenze, 3b4db4f561
The text was updated successfully, but these errors were encountered:
@Gaurab0664 As of Python version 3.9, fractions.gcd(a, b) has been moved to the math module.
As a temporary fix, you should change the line from fractions import gcd (at the beginning of this file) to from math import gcd
For me, changing the file ./BoundaryDelineation/lib/networkx/readwrite is also needed due to deprecation of the np.int. You should find this line and change (np.int, "int") to (int, "int").
It works with Python 3.11.6 and QGIS 3.34.3-Prizren.
I hope it helps.
ImportError: cannot import name 'gcd' from 'fractions' (C:\PROGRA
1\QGIS321.13\apps\Python39\lib\fractions.py)Traceback (most recent call last):
File "C:\PROGRA
1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 423, in startPluginplugins[packageName] = package.classFactory(iface)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation_init.py", line 37, in classFactory
from .BoundaryDelineation import BoundaryDelineation
File "C:\PROGRA
1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _importmod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation\BoundaryDelineation.py", line 48, in
import networkx as nx
File "C:\PROGRA
1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _importmod = builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation/lib\networkx_init.py", line 114, in
import networkx.generators
File "C:\PROGRA
1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _importmod = builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation/lib\networkx\generators_init.py", line 14, in
from networkx.generators.intersection import *
File "C:\PROGRA
1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _importmod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation/lib\networkx\generators\intersection.py", line 13, in
from networkx.algorithms import bipartite
File "C:\PROGRA
1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _importmod = builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation/lib\networkx\algorithms_init.py", line 16, in
from networkx.algorithms.dag import *
File "C:\PROGRA
1/QGIS321.13/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _importmod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Dell/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BoundaryDelineation/lib\networkx\algorithms\dag.py", line 23, in
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (C:\PROGRA
1\QGIS321.13\apps\Python39\lib\fractions.py)Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
QGIS version: 3.28.13-Firenze Firenze, 3b4db4f561
The text was updated successfully, but these errors were encountered: