pyinstaller / pyinstaller-hooks-contrib

Community maintained hooks for PyInstaller.
Other
96 stars 126 forks source link

Hidden imports not found with pydicom 3 #795

Closed bersbersbers closed 2 months ago

bersbersbers commented 2 months ago

Describe the bug

To Reproduce

A minimal example file:

from pydicom import dcmread
dcmread("")

PyInstaller command:

pyinstaller test.py

Error:

(.venv) C:\Code\project>dist\test\test.exe
Traceback (most recent call last):
  File "C:\ws\project\test.py", line 1, in <module>
    from pydicom import dcmread
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "pydicom\__init__.py", line 31, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "pydicom\dataelem.py", line 17, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "pydicom\config.py", line 367, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "pydicom\pixel_data_handlers\__init__.py", line 6, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "pydicom\pixels\__init__.py", line 3, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "pydicom\pixels\decoders\__init__.py", line 3, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "pydicom\pixels\decoders\base.py", line 1805, in <module>
  File "pydicom\pixels\common.py", line 130, in add_plugins
  File "pydicom\pixels\common.py", line 83, in add_plugin
  File "importlib\__init__.py", line 90, in import_module
ModuleNotFoundError: No module named 'pydicom.pixels.decoders.gdcm'
[PYI-32016:ERROR] Failed to execute script 'test' due to unhandled exception!

Expected behavior No ModuleNotFoundError

Desktop (please complete the following information):

bwoodsend commented 2 months ago

I think Rok's already working on that one. It got flagged up yesterday: https://github.com/pyinstaller/pyinstaller-hooks-contrib/pull/790#issuecomment-2339075464

rokm commented 2 months ago

Yeah, I'm almost done with sorting this one out.