Help needed to freeze a script.

L

LB

Hi,

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 freeze.py tool shipped with python2.5.
To complicate matters, I must say that I only have a local
installation
of python2.5 and numpy.

I used the following command line :
python2.5 ../Python-2.5.1/Tools/freeze/freeze.py ~/Python/numpy/test_freeze.py

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 numpy.core.info ...
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
_heapq
[...]
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/test_freeze.py", line 8, in <module>
import numpy as np
[...]
File "/home/loic/tmp/bluelagoon/lib/python2.5/site-packages/numpy/
core/__init__.py", 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
installation
> echo $PYTHONPATH
/home/loic/lib/python:/home/loic/tmp/bluelagoon/lib/python2.5:/home/
loic/tmp/bluelagoon/lib/python2.5/site-packages/:

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

1.2.0b2
no pb

Have you got any recipe to freeze numpy based script ?

Regards,
 
M

Michael Palmer

Hi,

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 freeze.py tool shipped with python2.5.
To complicate matters, I must say that I only have a local
installation
of python2.5 and numpy.

I used the following command line :
python2.5 ../Python-2.5.1/Tools/freeze/freeze.py ~/Python/numpy/test_freeze.py

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 numpy.core.info ...
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
_heapq
[...]
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/test_freeze.py", line 8, in <module>
import numpy as np
[...]
File "/home/loic/tmp/bluelagoon/lib/python2.5/site-packages/numpy/
core/__init__.py", 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
installation
echo $PYTHONPATH
/home/loic/lib/python:/home/loic/tmp/bluelagoon/lib/python2.5:/home/
loic/tmp/bluelagoon/lib/python2.5/site-packages/:

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

1.2.0b2
no pb

Have you got any recipe to freeze numpy based script ?

Regards,

Did you try py2exe instead of freeze? On the page

http://www.py2exe.org/index.cgi/WorkingWithVariousPackagesAndModules

there is only one brief mention of numpy packaging troubles,
suggesting that it might work better. I have used py2exe in the past
without much trouble.
 
L

LB

Did you try py2exe instead offreeze? On the page
http://www.py2exe.org/index.cgi/WorkingWithVariousPackagesAndModules

there is only one brief mention of numpy packaging troubles,
suggesting that it might work better. I have used py2exe in the past
without much trouble.

Unfortunately, I'm working under Linux and py2exe works only for
windows as far as I know.
Do you know if py2exe executable embedding a lot of C extensions -
like numpy and scipy - can ben executed on another computer, with a
different architecture (64bits vs 32 bits) and a different OS ?
 
G

Gabriel Genellina

Do you know if py2exe executable embedding a lot of C extensions -
like numpy and scipy - can ben executed on another computer, with a
different architecture (64bits vs 32 bits) and a different OS ?

Forget it, Jake.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top