Freeze Question

David Detlefsen detlefsend at enovatia.com
Mon Aug 4 20:59:14 CEST 2003


On 8/4/03 2:39 PM, "Skip Montanaro" <skip at pobox.com> wrote:

> 
>   David> 'import site' failed; use -v for traceback
>   David> Traceback (most recent call last):
>   David>   File "vnmrXserver.py", line 1, in ?
>   David>   File "/usr/local/lib/python2.2/SocketServer.py", line 131, in ?
>   David>   File "/usr/local/lib/python2.2/socket.py", line 41, in ?
>   David> ImportError: No module named _socket
> 
> Is this during the freeze operation or while running the frozen app?

This happens when I try to run the frozen application on a computer that
doesn't have python.

> Can you successfully execute
> 
>   import _socket

I can indeed run it where I freeze it (both the .py script and the frozen
application) and import _socket (of course) works fine.

> 
> from the Python interpreter prompt?  _socket.so should live in
> 
>   ${prefix}/lib/python2.3/lib-dynload
> 
>   David> So I guess I this means I have to rebuild python with static
>   David> linking (this is a mystery to me) OR is there a way to hack the
>   David> makefile (or perhaps some other file) and have the missing
>   David> modules found and included in the frozen program without a
>   David> rebuild of python?
> 
> You can fairly easily (though a bit tediously) build a static Python
> interpreter.  You need to edit Modules/Setup to uncomment the various
> extension modules you need.  This is what we all used to do before Greg Ward
> began attempting world domination through distutils.  There should be some
> documentation somewhere still about how to do this, perhaps in the
> introductory comments in Modules/Setup itself.  Yeah, looks like it's there.

Wait...I thought it was my turn to dominate the world!

And it's been a while since I've installed python on a SparcStation and
indeed, I may have found the binaries somewhere...are there any good places
that describe more explicitly how to build a static python?






More information about the Python-list mailing list