Closed thewtex closed 5 years ago
pyinstaller can be used with ITK if a hook is provided. The hook file should be named hook-itk.py
and its content should be:
from PyInstaller.utils.hooks import collect_data_files
hiddenimports = ['new']
# If ITK is pip installed, gets all the files.
itk_datas = collect_data_files('itk', include_py_files=True)
datas = [x for x in itk_datas if '__pycache__' not in x[0]]
In the meantime, before the PR is merged in pyinstaller (See link above), one can use the hook file above and add the following file to their command line when calling pyinstaller: --additional-hooks-dir
Closing this issue as there is no problem in ITK to use PyInstaller (see comments and links above).
Python tools to bundle applications and generate installers analyze Python
import
's to determined what should be included in the package. Some examples include pyinstaller, py2app, py2exe.To enable these apps to work with the ITK Python package, we need to make some changes to
itkBase.py
, e.g.known_modules
should be defined in the global namespaceexec
'ing the modules, use Python's import machinery.