Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import gcd from fractions #26

Open
mapperfr opened this issue Apr 12, 2023 · 1 comment
Open

Cannot import gcd from fractions #26

mapperfr opened this issue Apr 12, 2023 · 1 comment

Comments

@mapperfr
Copy link

Hi,

I'm running into an import error. Here's the log:

ImportError: cannot import name 'gcd' from 'fractions' (/usr/lib/python3.10/fractions.py) 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 423, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/chinesepostman/__init__.py", line 34, in classFactory
    from .chinesepostman import ChinesePostman
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/chinesepostman/chinesepostman.py", line 27, in 
    from . import postman
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/chinesepostman/postman.py", line 18, in 
    import networkx as nx
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/chinesepostman/lib/networkx-1.7-py2.7.egg/networkx/__init__.py", line 76, in 
    import networkx.algorithms
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/chinesepostman/lib/networkx-1.7-py2.7.egg/networkx/algorithms/__init__.py", line 11, in 
    from networkx.algorithms.dag import *
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/chinesepostman/lib/networkx-1.7-py2.7.egg/networkx/algorithms/dag.py", line 2, in 
    from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/usr/lib/python3.10/fractions.py)


Version de Python : 3.10.7 (main, Mar 10 2023, 10:47:39) [GCC 12.2.0] 
Version de QGIS : 3.30.1-'s-Hertogenbosch 's-Hertogenbosch, 447e8d717a 

Chemin Python :
/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/LAStools
/usr/share/qgis/python
/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python
/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python310.zip
/usr/lib/python3.10
/usr/lib/python3.10/lib-dynload
/home/jeremy/.local/lib/python3.10/site-packages
/usr/local/lib/python3.10/dist-packages
/usr/lib/python3/dist-packages
/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python
/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_resource_sharing
/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_resource_sharing/ext_libs
/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/mmqgis/forms
/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/ext-libs
/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis2web
/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/home/jeremy/carto/carto-ndls_hors-ligne/2023
/home/jeremy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/chinesepostman/lib/networkx-1.7-py2.7.egg
@SoundClash2
Copy link

SoundClash2 commented Oct 24, 2023

gcd on fractions are deprecated
Change fractions in dag.py to math

Edit: someone showed it in #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants