pyinstaller-hooks-contrib icon indicating copy to clipboard operation
pyinstaller-hooks-contrib copied to clipboard

Missing imports during packaging with PyInstaller 5.13 and pyinstaller-hooks-contrib 2023.12

Open rly opened this issue 6 months ago • 2 comments

Describe the bug Using PyInstaller 5.13 and the latest pyinstaller-hooks-contrib 2023.12 release results in ModuleNotFoundError: No module named 'h5py.defs' when running our tests on a PyInstaller executable (https://github.com/NeurodataWithoutBorders/nwb-guide/issues/559). Tests were passing with version 2023.11 using the same version of PyInstaller 5.13. Pinning pyinstaller-hooks-contrib to the earlier 2023.11 fixes the issue. Upgrading PyInstaller to the latest 6.3.0 also fixes the issue. So there seems to be an incompatibility between PyInstaller 5.13 and the latest pyinstaller-hooks-contrib 2023.12. I have not tested other versions beyond those mentioned.

The h5py hooks should have been loaded from https://github.com/pyinstaller/pyinstaller-hooks-contrib/blob/master/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-h5py.py but the logs indicate that they were not. This PR https://github.com/pyinstaller/pyinstaller-hooks-contrib/pull/677 was merged in 2023.12 . Since it relates to how pyinstaller finds hooks, I wonder if this caused the issue.

Since I was able to resolve this issue by upgrading to the latest version of PyInstaller, I have no requests. I'm creating this ticket to let you all know about the incompatibility and inform anyone else who might encounter the same issue. Feel free to close this.

To Reproduce Sorry, I am not a pyinstaller expert and creating a MWE would take some time...

Expected behavior Expected no change in pyinstaller behavior between pyinstaller-hooks-contrib = 2023.11 and pyinstaller-hooks-contrib = 2023.12.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: tested in Ubuntu, Mac. Not sure about Windows
  • Python Version: 3.9
  • Version of pyinstaller-hooks-contrib: 2023.12
  • Version of PyInstaller: 5.13

Additional context

rly avatar Jan 09 '24 07:01 rly