Unable to even run pyinstaller - pkg_resources.DistributionNotFound: The 'altgraph' distribution was not found and is required by the application

22 views
Skip to first unread message

Jacob Kruger

unread,
Apr 3, 2024, 5:37:56 AMApr 3
to pyins...@googlegroups.com
Hi there


Up until roundabout a week or so ago - not definite time frame since
don't necessarily make use of it too often - pyinstaller worked fine
here., but, this week it suddenly started generating the error message
mentioned in the subject line the moment I try to invoke it in any way
from command line interface.


As in, I can create a virtual environment, activate it, and use pip to
install pyinstaller, but, from there on, even if just try to invoke the
command pyinstaller, it generates traceback information ending in that
statement.


Now, for background, this is all running on my windows 11 pro 64-bit
machine, with all recent updates installed - just possible this started
occurring after latest windows update, and, while was initially working
under python-3.11.8-amd64, I now tried switching over to
python-3.12.2-amd64, in case it would make a difference, but, same
behaviour.


In other words, this occurs before I even try using pyinstaller to even
create an executable, even if I just invoke the command pyinstaller
after having run the pip command to import modules.


The current output of pip freeze is the following:

altgraph==0.17.4
packaging==24.0
pefile==2023.2.7
pyinstaller==6.5.0
pyinstaller-hooks-contrib==2024.3
pywin32-ctypes==0.2.2
setuptools==69.2.0

#---end of freeze---


And, if I invoke pyinstaller, here's the complete traceback output, in
case there's something in there am missing:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File
"C:\pythonScripts\dash\venv\Scripts\pyinstaller.exe\__main__.py", line
7, in <module>
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\PyInstaller\__main__.py",
line 228, in _console_script_run
run()
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\PyInstaller\__main__.py",
line 170, in run
    parser = generate_parser()
^^^^^^^^^^^^^^^^^
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\PyInstaller\__main__.py",
line 136, in generate_parser
    import PyInstaller.building.build_main
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\PyInstaller\building\build_main.py",
line 28, in <module>
    from PyInstaller.building.api import COLLECT, EXE, MERGE, PYZ
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\PyInstaller\building\api.py",
line 32, in <module>
    from PyInstaller.building.splash import Splash  # argument type
validation in EXE
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\PyInstaller\building\splash.py",
line 23, in <module>
    from PyInstaller.depend import bindepend
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\PyInstaller\depend\bindepend.py",
line 25, in <module>
    from PyInstaller.depend import dylib, utils
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\PyInstaller\depend\utils.py",
line 31, in <module>
    from PyInstaller.lib.modulegraph import modulegraph
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py",
line 34, in <module>
    from altgraph.ObjectGraph import ObjectGraph
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\altgraph\__init__.py",
line 144, in <module>
    __version__ = pkg_resources.require("altgraph")[0].version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\pkg_resources\__init__.py",
line 937, in require
    needed = self.resolve(parse_requirements(requirements))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\pkg_resources\__init__.py",
line 798, in resolve
    dist = self._resolve_dist(
^^^^^^^^^^^^^^^^^^^
  File
"C:\pythonScripts\dash\venv\Lib\site-packages\pkg_resources\__init__.py",
line 839, in _resolve_dist
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'altgraph' distribution was not
found and is required by the application

#---end output---


In any case all the google search results have come across using the
various keywords here, don't seem to mention specific behaviour similar
to this, unless am missing something, so, thought would ask here, just
in case?


Thanks in advance

--

Jacob Kruger
+2782 413 4791
"Resistance is futile!...Acceptance is versatile..."


Jacob Kruger

unread,
Apr 3, 2024, 5:42:21 AMApr 3
to pyins...@googlegroups.com
Sorry - could have mentioned that have had a look at following "when
things go wrong" page, which is why ended up posting on this list:

https://pyinstaller.org/en/latest/when-things-go-wrong.html


Jacob Kruger
+2782 413 4791
"Resistance is futile!...Acceptance is versatile..."


bwoodsend

unread,
Apr 3, 2024, 6:06:05 PMApr 3
to PyInstaller

I’m guessing you get the same error just running python -c "from altgraph.ObjectGraph import ObjectGraph"? Sounds more like a butchered altgraph install than anything to do with PyInstaller. Best I can suggest is to upgrade pip, wheel and setuptools then uninstall and reinstall altgraph.

Reply all
Reply to author
Forward
0 new messages