You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable Python import analysis for bundlers like pyinstaller, py2app, py2exe #214
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 namespace
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
Activity
fbudin69500 commentedon Jan 18, 2019
pyinstaller can be used with ITK if a hook is provided. The hook file should be named
hook-itk.pyand its content should be:fbudin69500 commentedon Jan 22, 2019
A PR for pyinstaller was opened
fbudin69500 commentedon Jan 24, 2019
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-dirfbudin69500 commentedon Feb 14, 2019
Closing this issue as there is no problem in ITK to use PyInstaller (see comments and links above).