[Numpy-discussion] Freezing numpy code

Pearu Peterson pearu at scipy.org
Thu Mar 30 00:38:01 CST 2006


On Wed, 29 Mar 2006, David Huard wrote:

> I would like to freeze some code in order to run it on machines without
> installing all the modules I use. I compiled Python 2.4.3 from source and
> rebuilt numpy. When I try to freeze the following code :
>
> #test.py
> from numpy import mean, rand
> x = rand(1000)
> print mean(x)
>
> with
>
> python /usr/share/doc/python2.4/examples/Tools/freeze/freeze.py test.py
> make
>
> I get the following error message :
>
> No scipy-style subpackage 'testing' found in n:u:m:p:y. Ignoring.
> No scipy-style subpackage 'core' found in n:u:m:p:y. Ignoring.
> No scipy-style subpackage 'lib' found in n:u:m:p:y. Ignoring.
> No scipy-style subpackage 'linalg' found in n:u:m:p:y. Ignoring.
> No scipy-style subpackage 'dft' found in n:u:m:p:y. Ignoring.
> No scipy-style subpackage 'random' found in n:u:m:p:y. Ignoring.
> No scipy-style subpackage 'f2py' found in n:u:m:p:y. Ignoring.
> Traceback (most recent call last):
>  File "test.py", line 1, in ?
>    from numpy import mean, rand
>  File "/usr/lib/python2.4/site-packages/numpy/__init__.py", line 44, in ?
>    __doc__ += pkgload.get_pkgdocs()
>  File "/usr/lib/python2.4/site-packages/numpy/_import_tools.py", line 320,
> in get_pkgdocs
>    retstr = self._format_titles(titles) +\
>  File "/usr/lib/python2.4/site-packages/numpy/_import_tools.py", line 283,
> in _format_titles
>    max_length = max(lengths)
> ValueError: max() arg is an empty sequence

I have fixed these errors in svn.

Now I get

   File "/usr/local/lib/python2.4/site-packages/numpy/core/numerictypes.py", line 
85, in ?
     from multiarray import typeinfo, ndarray, array, empty
ImportError: cannot import name typeinfo

I checked that given multiarray comes from Numeric. It looks like freeze 
is not able to freeze extension modules that are not in path.

Pearu




More information about the Numpy-discussion mailing list