Help with circular references problem

59 views
Skip to first unread message

Jose Rodriguez

unread,
May 25, 2022, 1:58:02 PM5/25/22
to PyInstaller
Hello,

I am using the latest version of pyinstaller (development) and I get the following. I checked for circular refs and used pycycle with none apparent. I tried other things from googling but I keep getting the same result. Any help? The output is:

src $ pyinstaller --debug=imports sg_cli.py
51 INFO: PyInstaller: 5.1
52 INFO: Python: 3.9.12
53 INFO: Platform: Linux-5.4.0-109-generic-x86_64-with-glibc2.31
54 INFO: wrote /home/jose/TNM/scenario-generator/src/sg_cli.spec
55 INFO: UPX is not available.
56 INFO: Extending PYTHONPATH with paths
['/home/jose/TNM/scenario-generator/src']
427 INFO: checking Analysis
427 INFO: Building Analysis because Analysis-00.toc is non existent
427 INFO: Initializing module dependency graph...
428 INFO: Caching module graph hooks...
438 INFO: Analyzing base_library.zip ...
3858 INFO: Processing pre-find module path hook distutils from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
3858 INFO: distutils: retargeting to non-venv dir '/usr/lib/python3.9'
7611 INFO: Caching module dependency graph...
7815 INFO: running Analysis Analysis-00.toc
7837 INFO: Analyzing /home/jose/TNM/scenario-generator/src/sg_cli.py
11212 INFO: Processing pre-safe import module hook six.moves from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-six.moves.py'.
12922 INFO: Processing pre-safe import module hook setuptools.extern.six.moves from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-setuptools.extern.six.moves.py'.
13472 INFO: Processing pre-find module path hook site from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-site.py'.
13473 INFO: site: retargeting to fake-dir '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/fake-modules'
17618 INFO: Processing pre-safe import module hook gi.repository.GLib from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.GLib.py'.
27209 INFO: Processing module hooks...
27209 INFO: Loading module hook 'hook-certifi.py' from '/home/jose/.local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
27213 INFO: Loading module hook 'hook-pytest.py' from '/home/jose/.local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
27419 INFO: Loading module hook 'hook-pydantic.py' from '/home/jose/.local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
27597 INFO: Loading module hook 'hook-py.py' from '/home/jose/.local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
28204 INFO: Loading module hook 'hook-lxml.py' from '/home/jose/.local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
2 WARNING: Failed to collect submodules for 'lxml.html' because importing 'lxml.html' raised: ImportError: cannot import name 'etree' from 'lxml' (/usr/lib/python3/dist-packages/lxml/__init__.py)
28771 INFO: Loading module hook 'hook-setuptools.py' from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
30146 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
30147 INFO: Loading module hook 'hook-packaging.py' from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
30147 INFO: Loading module hook 'hook-xml.dom.domreg.py' from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
30148 INFO: Loading module hook 'hook-matplotlib.backends.py' from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
30148 INFO: Matplotlib backend selection method: automatic discovery of used backends
30473 INFO: Trying determine the default backend as first importable candidate from the list: ['Qt5Agg', 'Gtk3Agg', 'TkAgg', 'WxAgg']
31654 INFO: None of the backend candidates could be imported; falling back to headless Agg!
31654 INFO: Selected matplotlib backends: ['Agg']
31654 INFO: Loading module hook 'hook-sysconfig.py' from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
31671 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
31676 INFO: Loading module hook 'hook-gi.py' from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
31693 INFO: Loading module hook 'hook-pickle.py' from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
31703 INFO: Loading module hook 'hook-gi.repository.GLib.py' from '/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
Traceback (most recent call last):
  File "/home/jose/.local/bin/pyinstaller", line 8, in <module>
    sys.exit(run())
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/__main__.py", line 178, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/__main__.py", line 59, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 842, in main
    build(specfile, distpath, workpath, clean_build)
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 764, in build
    exec(code, spec_namespace)
  File "/home/jose/TNM/scenario-generator/src/sg_cli.spec", line 7, in <module>
    a = Analysis(
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 319, in __init__
    self.__postinit__()
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/building/datastruct.py", line 173, in __postinit__
    self.assemble()
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 487, in assemble
    self.graph.process_post_graph_hooks(self)
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/depend/analysis.py", line 326, in process_post_graph_hooks
    module_hook.post_graph(analysis)
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/depend/imphook.py", line 398, in post_graph
    self._load_hook_module()
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/depend/imphook.py", line 361, in _load_hook_module
    self._hook_module = importlib_load_source(self.hook_module_name, self.hook_filename)
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/compat.py", line 620, in importlib_load_source
    return mod_loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 529, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1029, in load_module
  File "<frozen importlib._bootstrap_external>", line 854, in load_module
  File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 711, in _load
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/hooks/hook-gi.repository.GLib.py", line 28, in <module>
    binaries, datas, hiddenimports = get_gi_typelibs('GLib', '2.0')
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/utils/hooks/gi.py", line 71, in get_gi_typelibs
    typelibs_data = _gi_typelibs(module, version)
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/isolated/_parent.py", line 269, in wrapped
    return call(function, *args, **kwargs)
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/isolated/_parent.py", line 238, in call
    return isolated.call(function, *args, **kwargs)
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/isolated/_parent.py", line 176, in call
    raise RuntimeError(f"Child process call to {function.__name__}() failed with:\n" + output)
RuntimeError: Child process call to _gi_typelibs() failed with:
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/isolated/_child.py", line 63, in run_next_command
    output = function(*args, **kwargs)
  File "/home/jose/.local/lib/python3.9/site-packages/PyInstaller/utils/hooks/gi.py", line 58, in _gi_typelibs
    import gi
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
    from . import _gi
ImportError: cannot import name '_gi' from partially initialized module 'gi' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gi/__init__.py)
src $ 
Reply all
Reply to author
Forward
0 new messages