Repository navigation
PyInstaller 3.6 AssertionError #4626
Copy link
Copy link
Closed
Labels
Description
Hi, since the latest 3.6 release all my Linux builds are failing with a new AssertionError.
This is the log:
23 INFO: PyInstaller: 3.6
24 INFO: Python: 2.7.16
25 INFO: Platform: Linux-4.9.184-linuxkit-x86_64-with-debian-squeeze-sid
26 INFO: wrote /simulator.spec
35 INFO: UPX is not available.
36 INFO: Removing temporary files and cleaning cache in /.cache/pyinstaller
37 INFO: Extending PYTHONPATH with paths
['/agent/project/src/bin', '/']
37 INFO: checking Analysis
37 INFO: Building Analysis because Analysis-00.toc is non existent
38 INFO: Initializing module dependency graph...
49 INFO: Caching module graph hooks...
Traceback (most recent call last):
File "/usr/local/bin/pyinstaller", line 8, in <module>
sys.exit(run())
File "/usr/local/lib/python2.7/site-packages/PyInstaller/__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "/usr/local/lib/python2.7/site-packages/PyInstaller/__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/build_main.py", line 734, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/build_main.py", line 681, in build
exec(code, spec_namespace)
File "/simulator.spec", line 17, in <module>
noarchive=False)
File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/build_main.py", line 244, in __init__
self.__postinit__()
File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/datastruct.py", line 160, in __postinit__
self.assemble()
File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/build_main.py", line 343, in assemble
excludes=self.excludes, user_hook_dirs=self.hookspath)
File "/usr/local/lib/python2.7/site-packages/PyInstaller/depend/analysis.py", line 734, in initialize_modgraph
user_hook_dirs=user_hook_dirs,
File "/usr/local/lib/python2.7/site-packages/PyInstaller/depend/analysis.py", line 116, in __init__
self._reset(user_hook_dirs)
File "/usr/local/lib/python2.7/site-packages/PyInstaller/depend/analysis.py", line 134, in _reset
self._hooks = self._cache_hooks("")
File "/usr/local/lib/python2.7/site-packages/PyInstaller/depend/analysis.py", line 215, in _cache_hooks
return ModuleHookCache(self, hook_dirs)
File "/usr/local/lib/python2.7/site-packages/PyInstaller/depend/imphook.py", line 100, in __init__
self._cache_hook_dirs(hook_dirs)
File "/usr/local/lib/python2.7/site-packages/PyInstaller/depend/imphook.py", line 133, in _cache_hook_dirs
hook_module_name_prefix=self._hook_module_name_prefix,
File "/usr/local/lib/python2.7/site-packages/PyInstaller/depend/imphook.py", line 289, in __init__
assert self.hook_module_name not in HOOKS_MODULE_NAMES
AssertionError
PyInstaller: 3.6
OS: Linux & macOS
Python: 2.7
After reverting to version 3.5 it seems to work fine, what can I do to try to find the source of this issue?
Reacted by Mark McWilliams, Luigi Cruz, AndCycle, Matt Einhorn, Sam Martin-Brown, Karl Bartel, Jário José, Tom Watson and Norvin
Activity
AndCycle commentedon Jan 13, 2020
did simple test shows it died on my custom
geventhook,remove custom hook pleased PyInstaller.
maybe you can share what died on your setup?
self.hook_module_namevalue is__PyInstaller_hooks_0_geventmine
hook-gevent.pyand this is not the only place that failed, still digging.
Workaround for pyinstaller/pyinstaller#4626.
workaround for pyinstaller/pyinstaller#4626
htgoebel commentedon Jan 17, 2020
@AndCycle Since you already have a clue and an environment which triggers this isse: Please track sit down, and send me an email afterwards. Many thanks.
AndCycle commentedon Jan 17, 2020
@htgoebel
04d63e1
the safety check triggered when there is a custom hook conflict with builtin one.
an empty hook file can trigger it.
arossert commentedon Jan 19, 2020
@AndCycle Thanks for the investigation, it was indeed a hook that I had in my code and the same hook was represented in the new version (from my PR 😃).
Even when the hooks are exactly the same it is failing.
robertobrien130 commentedon Jan 19, 2020
I was also getting this error, but after I rolled back to 3.5, I started getting this error when I launched my
--windowedapp:I wasn't getting this error before the upgrade to 3.6. If I build the app without the
--windowedoption, the app crashes and closes the command window before I can copy the traceback error.Using Windows 10, Python 3.7.6.
Any help you guys can give?
matham commentedon Jan 19, 2020
Please open another issue for this, as it's off-topic of this issue.
Try running the app from an existing cmd terminal, then the traceback will remain written on that terminal.
DarkFenX commentedon Jan 20, 2020
I have the same issue.
Pyinstaller fails on
__PyInstaller_hooks_0_matplotlib_backends(verified by printing before the assertion).Edit:
As comment above mentioned a conflict between hooks, i checked configuration:
I had custom hook for matplotlib there indeed, so I just removed it to give it a try, and so far it works.
Legorooj commentedon Jan 22, 2020
@robertobrien130 run the exe from the command prompt (built without the windowed command).
Legorooj commentedon Jan 22, 2020
@DarkFenX So you're saying its fixed when you remove the
hookspathline from the spec?DarkFenX commentedon Jan 22, 2020
@Legorooj I did not remove hookspath specification. I just removed offending file (had matplotlib hooks file in the specified path).
Legorooj commentedon Jan 22, 2020
@DarkFenX Ah. These were custom hooks I'm assuming? I know that PyInstaller has hooks included already for matplotlib, although there is one bug for matplotlib=<3.1.
10 remaining items
Legorooj commentedon Feb 15, 2020
#4698 is a "fix" as such, meaning it'll now tell you that you need to remove X custom hook - It actually tells you which one.
Workaround for pyinstaller/pyinstaller#4626.
matham commentedon Mar 2, 2020
Should this be closed, given that the fix simply tells you which hook is duplicated? Or is overriding a hook present in pyinstaller source with a custom version of the hook not officially supported?
Legorooj commentedon Mar 3, 2020
@matham if you want to override default hooks, you currently have to edit the PyInstaller one. Otherwise, submit a PR that adds an option
--prefer-customwhich, when presented with a custom hook and a default one, prefers the custom hook.Legorooj commentedon Mar 3, 2020
Btw this wasn't a bug; it's simply the absence of an error message.
remove custom hook
remove custom hook
Failed start-up on Windows [PMF-85] [INFRA-128] (#1143)
Failed start-up on Windows [PMF-85] [INFRA-128] (#1143)
Failed start-up on Windows [PMF-85] [INFRA-128] (#1143)
Merge cherry-picks from refs/heads/v2.4.0-release (81543be) into mast…