[Numpy-discussion] a question about freeze on numpy 1.7.0

Gelin Yan dynamicgl@gmail....
Mon Feb 25 00:49:32 CST 2013


On Mon, Feb 25, 2013 at 9:16 AM, Ondřej Čertík <ondrej.certik@gmail.com>wrote:

> Hi Gelin,
>
> On Sun, Feb 24, 2013 at 12:08 AM, Gelin Yan <dynamicgl@gmail.com> wrote:
> > Hi All
> >
> >      When I used numpy 1.7.0 with cx_freeze 4.3.1 on windows, I quickly
> > found out even a simple "import numpy" may lead to program failed with
> > following exception:
> >
> > "AttributeError: 'module' object has no attribute 'sys'
> >
> > After a poking around some codes I noticed /numpy/core/__init__.py has a
> > line 'del sys' at the bottom. After I commented this line, and repacked
> the
> > whole program, It ran fine.
> > I also noticed this 'del sys' didn't exist on numpy 1.6.2
> >
> > I am curious why this 'del sys' should be here and whether it is safe to
> > omit it. Thanks.
>
> The "del sys" line was introduced in the commit:
>
>
> https://github.com/numpy/numpy/commit/4c0576fe9947ef2af8351405e0990cebd83ccbb6
>
> and it seems to me that it is needed so that the numpy.core namespace is
> not
> cluttered by it.
>
> Can you post the full stacktrace of your program (and preferably some
> instructions
> how to reproduce the problem)? It should become clear where the problem is.
>
> Thanks,
> Ondrej
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>

Hi Ondrej

    I attached two files here for demonstration. you need cx_freeze to
build a standalone executable file. simply running python setup.py build
and try to run the executable file you may see this exception. This example
works with numpy 1.6.2. Thanks.

Regards

gelin yan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130225/e61a505f/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: numpytest.py
Type: application/octet-stream
Size: 89 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130225/e61a505f/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup.py
Type: application/octet-stream
Size: 762 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130225/e61a505f/attachment-0001.obj 


More information about the NumPy-Discussion mailing list