sys.exit(_console_script_run())

36 views
Skip to first unread message

paolo zordan

unread,
Oct 24, 2024, 5:29:56 AM10/24/24
to PyInstaller
hi, I need some help

Ubuntu environment
python3 version 3.12.3
pyinstaller version 6.11

error: pyinstaller test.py --onefile


File "/home/paolo/sorgenti/ambpaolo/bin/pyinstaller", line 8, in <module>
    sys.exit(_console_script_run())
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/paolo/sorgenti/ambpaolo/lib/python3.12/site-packages/PyInstaller/__main__.py", line 231, in _console_script_run
    run()
  File "/home/paolo/sorgenti/ambpaolo/lib/python3.12/site-packages/PyInstaller/__main__.py", line 172, in run
    parser = generate_parser()
             ^^^^^^^^^^^^^^^^^
  File "/home/paolo/sorgenti/ambpaolo/lib/python3.12/site-packages/PyInstaller/__main__.py", line 137, in generate_parser
    import PyInstaller.building.build_main
  File "/home/paolo/sorgenti/ambpaolo/lib/python3.12/site-packages/PyInstaller/building/build_main.py", line 28, in <module>
    from PyInstaller.building.api import COLLECT, EXE, MERGE, PYZ
  File "/home/paolo/sorgenti/ambpaolo/lib/python3.12/site-packages/PyInstaller/building/api.py", line 33, in <module>
    from PyInstaller.building.splash import Splash  # argument type validation in EXE
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/paolo/sorgenti/ambpaolo/lib/python3.12/site-packages/PyInstaller/building/splash.py", line 23, in <module>
    from PyInstaller.depend import bindepend
  File "/home/paolo/sorgenti/ambpaolo/lib/python3.12/site-packages/PyInstaller/depend/bindepend.py", line 25, in <module>
    from PyInstaller.depend import dylib, utils
  File "/home/paolo/sorgenti/ambpaolo/lib/python3.12/site-packages/PyInstaller/depend/utils.py", line 32, in <module>
    from PyInstaller.lib.modulegraph import modulegraph
  File "/home/paolo/sorgenti/ambpaolo/lib/python3.12/site-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 34, in <module>
    from altgraph.ObjectGraph import ObjectGraph
  File "/home/paolo/sorgenti/ambpaolo/lib/python3.12/site-packages/altgraph/__init__.py", line 142, in <module>
    import pkg_resources
  File "/home/paolo/sorgenti/ambpaolo/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2191, in <module>
    register_finder(pkgutil.ImpImporter, find_on_path)

bwoodsend

unread,
Oct 24, 2024, 8:35:48 AM10/24/24
to PyInstaller

Surely there are some more lines of error message after that?

Either way though, it looks like the error is coming from a mere import pkg_resources so is most likely between you and setuptools rather than anything to do with PyInstaller.

paolo zordan

unread,
Oct 24, 2024, 10:51:52 AM10/24/24
to PyInstaller
hello, and thanks, actually missing:
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

Same error if I type , from within virtual environment

pyinstaller --h 


bwoodsend

unread,
Oct 26, 2024, 8:20:07 PM10/26/24
to PyInstaller
Sounds like your setuptools is too old to support Python 3.12. Have you tried just upgrading it?

paolo zordan

unread,
Oct 27, 2024, 6:30:10 AM10/27/24
to PyInstaller
thanks, I solved it by installing:

pip install --upgrade setuptools
Reply all
Reply to author
Forward
0 new messages