
Hi all, An issue just came up with numpy and py2exe on the wxPython list. A solution has been found, but I thought I'd post here, so that it could be on the numpy developers' radar when considering the structure of numpy for the future:
I'm compile a wxPython script using GUI2Exe, and am getting the following when running the produced exe:
$ ./dist/svm.exe Traceback (most recent call last): File "svm.py", line 28, in <module> import graphic_svm_data File "graphic_svm_data.pyo", line 29, in <module> File "floatcanvas\NavCanvas.pyo", line 7, in <module> File "floatcanvas\FloatCanvas.pyo", line 7, in <module> File "numpy\__init__.pyo", line 93, in <module> File "numpy\add_newdocs.pyo", line 9, in <module> File "numpy\lib\__init__.pyo", line 19, in <module> File "numpy\lib\financial.pyo", line 78, in <module> TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
I tried to add numpy.lib.financial to the Excludes and Ignores list, but am still getting this error.
Googling found that this problem is a known bug: http://article.gmane.org/gmane.comp.python.py2exe/2920
The solution was to:
2) Use Optimize=1 or Optimize=0 in GUI2Exe and re-build your executable. Uing Optimize=2 strips all docstrings in the executable, which may cause troubles (as in your case);
[Ron Barak] YES!!! With Optimize=1 my script finally compiles to exe.
While this worked, I have a couple observations: 1) This broke on numpy.lib.financial. that had nothing to do with the issue, but it would be nice if people could use numpy with py2exe and the like without having to include all those unused packages. I think this ties in with the discussion about speeding up with importing process, and may be addressed in future versions if I understood the results of some of the discussion at SciPy right. 2) it would also be nice if one could use numpy with the docstrings removed, like in this case. I have no idea what the issues are with that. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov

On Thu, Aug 28, 2008 at 11:36 AM, Christopher Barker <Chris.Barker@noaa.gov>wrote:
Hi all,
An issue just came up with numpy and py2exe on the wxPython list. A solution has been found, but I thought I'd post here, so that it could be on the numpy developers' radar when considering the structure of numpy for the future:
I'm compile a wxPython script using GUI2Exe, and am getting the following when running the produced exe:
$ ./dist/svm.exe Traceback (most recent call last): File "svm.py", line 28, in <module> import graphic_svm_data File "graphic_svm_data.pyo", line 29, in <module> File "floatcanvas\NavCanvas.pyo", line 7, in <module> File "floatcanvas\FloatCanvas.pyo", line 7, in <module> File "numpy\__init__.pyo", line 93, in <module> File "numpy\add_newdocs.pyo", line 9, in <module> File "numpy\lib\__init__.pyo", line 19, in <module> File "numpy\lib\financial.pyo", line 78, in <module> TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
I tried to add numpy.lib.financial to the Excludes and Ignores list, but am still getting this error.
Googling found that this problem is a known bug: http://article.gmane.org/gmane.comp.python.py2exe/2920
The solution was to:
<snip> This needs to be fixed in trunk, please open a ticket. There have been several other fixes for -OO recently and I don't think we are done with them yet. Chuck

On Thu, Aug 28, 2008 at 11:50 AM, Charles R Harris < charlesr.harris@gmail.com> wrote:
On Thu, Aug 28, 2008 at 11:36 AM, Christopher Barker < Chris.Barker@noaa.gov> wrote:
Hi all,
An issue just came up with numpy and py2exe on the wxPython list. A solution has been found, but I thought I'd post here, so that it could be on the numpy developers' radar when considering the structure of numpy for the future:
I'm compile a wxPython script using GUI2Exe, and am getting the following when running the produced exe:
$ ./dist/svm.exe Traceback (most recent call last): File "svm.py", line 28, in <module> import graphic_svm_data File "graphic_svm_data.pyo", line 29, in <module> File "floatcanvas\NavCanvas.pyo", line 7, in <module> File "floatcanvas\FloatCanvas.pyo", line 7, in <module> File "numpy\__init__.pyo", line 93, in <module> File "numpy\add_newdocs.pyo", line 9, in <module> File "numpy\lib\__init__.pyo", line 19, in <module> File "numpy\lib\financial.pyo", line 78, in <module> TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
I tried to add numpy.lib.financial to the Excludes and Ignores list, but am still getting this error.
Googling found that this problem is a known bug: http://article.gmane.org/gmane.comp.python.py2exe/2920
The solution was to:
<snip>
This needs to be fixed in trunk, please open a ticket. There have been several other fixes for -OO recently and I don't think we are done with them yet.
I thought I had seen this before and indeed it has been reported. However, financial has been changed and this particular error should no longer be a problem. Chuck

Charles R Harris wrote:
This needs to be fixed in trunk, please open a ticket. There have been several other fixes for -OO recently and I don't think we are done with them yet.
already there: http://scipy.org/scipy/numpy/ticket/893 and: http://scipy.org/scipy/numpy/ticket/894 -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov
participants (2)
-
Charles R Harris
-
Christopher Barker