HPGL and py2exe


We have used py2exe lately and seems like it can't handle complex python modules. By 'complex' I mean modules which are containes files other than the *.py ones (libraries, images, etc). HPGL is the one, because almost all geostatistics algorithms are implemented in C++ library which is included in the python package.

The solution is to use specific building properties (compressed = 0, bundle_files = 3). With this settings py2exe puts all dependent modules into the destination directory and adds this directory to the PYTHONPATH variable for the integrated python interpretator. So you can just copy desired 'complex' modules in this directory on building.

We use this approach for the HPGL-GUI project and it works like a charm.

The main disadvantage of this approach is that you can't make single executable file but it's always possible to make an archive or installer package from the builded directory.

py2exe script