Help needed to freeze a script.

LB berthe.loic at
Wed Sep 3 19:30:01 CEST 2008


I would like to freeze a numpy based script in order to have an
application which could run without having to install numpy and cie.

Indeed, I'm not root on the targeted computer and I can't easily
make a complete install of numpy and scipy.

So I decided to test the tool shipped with python2.5.
To complicate matters, I must say that I only have a local
of python2.5 and numpy.

I used the following command line :

> python2.5 ../Python-2.5.1/Tools/freeze/ ~/Python/numpy/

At first sight, it seems to be fine, as I saw numpy in the liste of
frozen dependancies :
freezing numpy ...
freezing numpy.__config__ ...
freezing numpy._import_tools ...
freezing numpy.add_newdocs ...
freezing numpy.core ...
freezing numpy.core._internal ...
freezing numpy.core.arrayprint ...
freezing numpy.core.defchararray ...
freezing numpy.core.defmatrix ...
freezing numpy.core.fromnumeric ...
freezing ...
freezing numpy.core.memmap ...
freezing numpy.core.numeric ...
freezing numpy.core.numerictypes ...
freezing numpy.core.records ...
freezing numpy.ctypeslib ...
freezing numpy.version ...

But at the end I saw this message :
Warning: unknown modules remain: _bisect _csv _ctypes _curses _hashlib
numpy.core._dotblas numpy.core._sort numpy.core.multiarray
numpy.core.scalarmath numpy.core.umath numpy.fft.fftpack_lite
numpy.lib._compiled_base numpy.linalg.lapack_lite numpy.random.mtrand
operator parser pyexpat readline
Now run "make" to build the target: test_weibull

I runned make without any problem but the final application didn't
work :
% ./test_freeze
Traceback (most recent call last):
  File "/home/loic/Python/numpy/", line 8, in <module>
    import numpy             as np
  File "/home/loic/tmp/bluelagoon/lib/python2.5/site-packages/numpy/
core/", line 5, in <module>
    import multiarray
ImportError: No module named multiarray

Is there any known issue when freezing a numpy based script ?
I should add that I configured my PYTHONPATH to match my local

and this local installation work fine :
> python2.5 -c 'import numpy; print numpy.__version__; import numpy.core.multiarray; print "no pb"'

no pb

Have you got any recipe to freeze numpy based script ?



More information about the Python-list mailing list