[Insight-users] Freezing itk python executables

Lassi Paavolainen lassi.paavolainen at jyu.fi
Wed Apr 20 03:17:55 EDT 2011


Hi Peter,

We use py2exe to build package for our software. If I remember correctly, 
py2exe cannot find ITK since ITK libs are loaded dynamically.

I'm not sure if our way is the best option, but at least it works. We use 
a script that copies ITK libs and ITK Python libs + py files into own ITK 
directory structure and then in our main Python script add those to path.

Cheers,
Lassi

On Tue, 19 Apr 2011, Peter wrote:

> Hi,
>
> I apologise if this is not the correct place to post this, so please forgive me or correct me. I am trying to build executables
> from python scripts under Windows XP. The python scripts use itk and the .py scripts work fine, but I want to 'freeze' them. I
> have tried both py2exe and cx_freeze, and they both fail to locate itk during the build process. I am assuming that this is due
> to the fact that the python itk is not under C:\Python26, but under the directory I defined during cmake, and subsequent
> compilation.
>
> I have a couple of questions; firstly what is the best way to include itk within python, at the moment I have added directories
> to the PATH and PYTHONPATH environment variables) and then call 'import itk' from within python.
>
> Secondly, if anyone has used either 'py2exe' or 'cs_freeze' to build executables from python scripts that import itk could they
> point me in the direction of any information.
>
> Thanks in advance,
>
> Peter
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>

-- 
Lassi Paavolainen, M.Sc
Software Engineer, PhD Student in Computer Science
BioImageXD (http://www.bioimagexd.net)
University of Jyväskylä
The Department of Biological and Environmental Science
lassi.paavolainen at jyu.fi


More information about the Insight-users mailing list