Hi, Travis I can pack my scripts into an executable with py2exe, but errors occur once it runs: No scipy-style subpackage 'random' found in D:\test\dist\numpy. Ignoring: No module named info import core -> failed: No module named _internal import lib -> failed: 'module' object has no attribute '_ARRAY_API' import linalg -> failed: 'module' object has no attribute '_ARRAY_API' import dft -> failed: 'module' object has no attribute '_ARRAY_API' Traceback (most recent call last): File "main.py", line 9, in ? File "numpy\__init__.pyc", line 49, in ? File "numpy\add_newdocs.pyc", line 2, in ? gkDc File "numpy\lib\__init__.pyc", line 5, in ? File "numpy\lib\type_check.pyc", line 8, in ? File "numpy\core\__init__.pyc", line 6, in ? File "numpy\core\umath.pyc", line 12, in ? File "numpy\core\umath.pyc", line 10, in __load AttributeError: 'module' object has no attribute '_ARRAY_API' This is the main.py file: #======================================= # filename:main.py import wx import numpy class myFrame(wx.Frame): def __init__(self, *args, **kwds): wx.Frame.__init__(self, *args, **kwds) ##------ your widgets ##------ put stuff into sizer self.sizer_ = wx.BoxSizer(wx.VERTICAL) ## self.sizer_.Add(your_ctrl, proportion = 1, flag = wx.EXPAND) ## apply sizer self.SetSizer(self.sizer_) self.SetAutoLayout(True) def main(): ## {{{ app = wx.PySimpleApp(0) frame = myFrame(None, -1, title = '') frame.Show(True) app.SetTopWindow(frame) app.MainLoop() ## }}} if __name__ == "__main__":main() #======================================= # filename:setup.py import glob import sys from distutils.core import setup import py2exe includes = ["encodings", "encodings.*", ] excludes = ["javax.comm"] options = { "py2exe": { #"compressed": 1, #"optimize": 0, #"bundle_files":2, "skip_archive":1, "includes": includes, 'excludes': excludes } } setup( version = "0.1", description = "", name = "test", options = options, windows = [ { "script":"main.py", } ], #zipfile = None, ) and I run this command to compile the scripts: python setup.py py2exe and all packages I use are: python2.4.3 numpy-0.98 py2exe-0.6.5 wxpython-2.6.3.2 I unistalled Numeric before I compiled scripts. If you google "numpy py2exe", you can find others guys stumbled by the same issue with ease: http://aspn.activestate.com/ASPN/Mail/Message/py2exe-users/3249182 http://www.nabble.com/matplotlib,-numpy-and-py2exe-t1901429.html I just hope this can be fixed in the next table release of numpy. On 8/29/06, Travis Oliphant <oliphant.travis@ieee.org> wrote:
bruce.who.hk wrote:
Hi, Travis
I just wonder if NumPy 1.0b4 can get along with py2exe? Just a few weeks ago I made a application in Python. At first I used Numpy, it works OK, but I cannot pack it into a workable executable with py2exe and the XXX.log saied that numpy cannot find some module. I found some hints in py2exe wiki, but it still doesn't work. At Last I tried Numeric instead and it got OK. I just hope that you donnot stop the maintenance of Numeric before you are sure that Numpy can work with py2exe.
We've already stopped maintenance of Numeric nearly 1 year ago. If NumPy doesn't work with py2exe then we need help figuring out why. The beta-release period is the perfect time to fix that. I've never used py2exe myself, but I seem to recall that some have been able to make it work.
The problem may just be listing the right set of modules to carry along because you may not be able to get that with just the Python-side imports. Post any errors you receive to numpy-discussion@lists.sourceforge.net
Thanks,
-Travis
Bruce Who
participants (1)
-
Bruce Who