[Tutor] freeze

A.T.Hofkamp a.t.hofkamp at tue.nl
Mon Jun 29 09:08:36 CEST 2009

col speed wrote:
> HI Guys,
> I have a small programme, called shop.py,  that I wish to make into a
> "frozen binary" ( I think that's right - I'm using Linux Ubuntu 9.04
> and I want the programme to work on a windows computer that doesn't
> have Python installed).
> I used freeze.py from examples/Tools and everything seemed to be going
> well (I won't post the output as there is so much), but the last lines
> are:
> o M_xml__sax__xmlreader.o M_xmllib.o M_xmlrpclib.o
> /usr/lib/python2.6/config/libpython2.6.a -L/usr/lib -lz  -lpthread
> -ldl  -lutil -lm  -o shop
> /usr/bin/ld: cannot find -lz
> collect2: ld returned 1 exit status
> make: *** [shop] Error 1
> Any ideas of what is going wrong?

The linker cannot link against the 'z' library :)
At my Linux system, that library is at "/usr/lib/libz.a", which comes from the 
'zlib-devel' RPM. No doubt Ubuntu has a similar name for the z library.

I don't know what you are doing exactly, but it seems to me that a program 
linked against Linux libraries is not going to work at a non-linux system 
(much like you cannot run Windows binaries natively at a Linux system).

You may need to do the freezing at a Windows system or use a cross-compiler.

> I would also like to ask your opinion - the programme is very small
> (only 1.2kb!). Is there another way ? Am I totally wasting my time?

Install Python at the Windoes machine, and run shop.py in natively would seem 
like an alternative.
Even with freeze, you are basically installing Python, except it has a 
different name.


More information about the Tutor mailing list