# PyInstaller with ITK Python wrapping built from source

**URL:** https://discourse.itk.org/t/pyinstaller-with-itk-python-wrapping-built-from-source/2411
**Category:** Beginner Questions
**Tags:** cmake, python
**Created:** [November 15, 2019, 9:44am UTC](https://discourse.itk.org/t/pyinstaller-with-itk-python-wrapping-built-from-source/2411 "2019-11-15T09:44:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Aisec](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/e68b1a/32.png) [@Aisec](https://discourse.itk.org/u/Aisec)
#### Post date: [November 15, 2019, 9:44am UTC](https://discourse.itk.org/t/pyinstaller-with-itk-python-wrapping-built-from-source/2411/1 "2019-11-15T09:44:42Z")

</div>

Hello,  
I need to create windows 7 binaries of Python application that uses ITK, both 64 and 32 bit versions. I successfully created 64 bit version with itk installed using pip and using this hook file, which i found somewhere:

> **hook file**
>
> ```python
> 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]]
> 
> ```

But for my 32 bit Python environment I built itk from source with ITK\_WRAP\_PYTHON option enabled. It works in interpreter, but i can’t package it using PyInstaller the same way I did with 64 bit. So is there a way to do so? I barely know what i’m doing so any piece of advice would be helpful.

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [November 15, 2019, 12:29pm UTC](https://discourse.itk.org/t/pyinstaller-with-itk-python-wrapping-built-from-source/2411/2 "2019-11-15T12:29:24Z")

</div>

You want to look at the ITKPythonPackage project for packaging ITK wrapping:

> **[InsightSoftwareConsortium/ITKPythonPackage](https://github.com/InsightSoftwareConsortium/ITKPythonPackage)**
>
> A setup script to generate ITK Python Wheels. Contribute to InsightSoftwareConsortium/ITKPythonPackage development by creating an account on GitHub.

We are just about to drop 32-bit support for SimpleITK. May I ask why you are continuing to support 32-bits? The download statistics for SimpleITK 32-bits are so very low compared to 64-bits that it does not appear to be more than bot downloads.
