473,416 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

problem w/ numarray & py2exe...

RJS
Hi all,

I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32-
py2.2).
Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222.
In the sample below, commenting out "import numarray" allows the exe to
run. Left in, I get "4.exe has generated errors" etc.

I'm going around and around and there isn't much on Google.
py2exe output is last.

With "Python 4.py" from the shell, all is well. Any ideas? Older numarray?
Numeric?

Ray
http://rjs.org

############################### setup.py #############
from distutils.core import setup
import py2exe

setup(name="tf.4",
scripts=["4.py"],
)

############################# 4.py code ################
from wxPython.wx import *
import numarray
import array
import operator
from random import Random
ID_STUB = 10

ID_IMPORT_XRC = 100
ID_PLOT = 111
ID_TRAIN = 122
ID_EXPORT_ONEREV= 124
ID_EXIT = 199
ID_ABOUT = 141

############################# Class defs #############################

class MainFrame(wxFrame):
def __init__(self, parent, ID, title):
wxFrame.__init__(self, parent, ID, title, wxDefaultPosition,
wxSize(800, 400))
if wxPlatform == '__WXMSW__':
self.icon = wxIcon('imagery/rotor.ico', wxBITMAP_TYPE_ICO)
self.SetIcon(self.icon)
self.Centre(direction = wxBOTH)

self.CreateStatusBar()
self.SetStatusText("Status: ready")

## create the menubar
fileMenu = wxMenu()
fileMenu.Append(ID_IMPORT_XRC, "Import &*.xrc", "Import an xrc data
file")
fileMenu.AppendSeparator()
fileMenu.Append(ID_EXPORT_ONEREV, "&Export", "Export One Rev data")
fileMenu.AppendSeparator()
fileMenu.Append(ID_EXIT, "E&xit", "Terminate the program")

toolsMenu = wxMenu()
toolsMenu.Append(ID_STUB, "Color", "Change the color scheme")
toolsMenu.AppendSeparator()
toolsMenu.Append(ID_PLOT, "Plot", "Plot the data")
toolsMenu.Append(ID_TRAIN, "Train", "Train on the data")

helpMenu = wxMenu()
helpMenu.Append(ID_STUB, "&Help", "Index and glossary")
helpMenu.AppendSeparator()
helpMenu.Append(ID_ABOUT, "&About", "More information about this
program")

menuBar = wxMenuBar()
menuBar.Append(fileMenu, "&File");
menuBar.Append(toolsMenu, "&Tools");
menuBar.Append(helpMenu, "&Help");
self.SetMenuBar(menuBar)

EVT_MENU(self, ID_IMPORT_XRC, self.OnImportXRC)
EVT_MENU(self, ID_PLOT, self.createPlot)
EVT_MENU(self, ID_TRAIN, self.OnTraining)
EVT_MENU(self, ID_EXPORT_ONEREV, self.OnExport)
EVT_MENU(self, ID_ABOUT, self.OnAbout)
EVT_MENU(self, ID_EXIT, self.ExitFrame)

##### create and add notebook pages
################################################## ##################
self.nb = wxNotebook(self, -1)
self.fontObj = wxFont(11, wxMODERN, wxNORMAL, wxNORMAL, false)

def OnAbout(self, event):
dlg = wxMessageDialog(self, "Welcome to\n"
"Turbine v.1\n",
"Welcome", wxOK | wxICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()
self.nb.DeletePage(0)

def ExitFrame(self, event):
self.Close(true)
# ----------------------------------------------------------------------
------------------
# handlers.
# ----------------------------------------------------------------------
------------------

def OnImportXRC(self, event):
self.dataPoints = 5000
# open the header file
dlg = wxFileDialog (self, "Select the XRC file for import", "data",
"", "*.xrc", wxOPEN)
if dlg.ShowModal() == wxID_OK:
try:
self.filePath = dlg.GetPath()
except IOError:
dlg_m = wxMessageDialog (self,
'There was an error opening the new
xrc file.',
'Error!', wxOK)
dlg_m.ShowModal()
dlg_m.Destroy()
dlg.Destroy()

def createDataArray(self):
# create the XRC tabs
self.nb.xrcHeader = wxTextCtrl(self.nb, -1, "",wxPoint(0, 0),
wxSize(75, 20), wxTE_MULTILINE|wxTE_RICH )
self.nb.xrcHeader.SetStyle(0, self.nb.xrcHeader.GetLastPosition(),
wxTextAttr("BLACK", wxNullColour, self.fontObj))
self.nb.AddPage(self.nb.xrcHeader, "XRC Header: "+self.filePath)
self.nb.xrcHeader.LoadFile(self.filePath)

def createPlot(self, event=NULL):
plotWidthPoints = 5000

def OnExport(self, event):
self.nb.SetSelection(1)

def OnTraining(self, event=NULL):
firstSet = TRUE
def createOneRevPlot(self, pointsPerRev, revs):
plotWidthPoints = int(pointsPerRev)
self.nb.AdvanceSelection()

def OnExport(self, event):
self.nb.SetSelection(3)

def histogram(self,a, bins):
return 1

############### Main application class ###########
class App(wxApp):
def OnInit(self):
frame = MainFrame(NULL, -1, "Turbine ")
frame.Show(true)
self.SetTopWindow(frame)
return true
app = App(0)
app.MainLoop()



################# py2exe output #####################
D:\projects\fingerprinting>python setup.py py2exe
running py2exe
running build
running build_scripts
not copying 4.py (up-to-date)
running install_scripts
creating build\bdist.win32\winexe
creating build\bdist.win32\winexe\lib
creating build\bdist.win32\winexe\lib\Python
creating build\bdist.win32\winexe\lib\Python\Scripts
copying build\scripts-2.2\4.py ->
build\bdist.win32\winexe\lib\Python\Scripts
copying build\scripts-2.2\tf.4.py ->
build\bdist.win32\winexe\lib\Python\Scripts

copying build\scripts-2.2\tf.5.py ->
build\bdist.win32\winexe\lib\Python\Scripts

+----------------------------------------------------
| Processing script 4.py with py2exe-0.3.4
+----------------------------------------------------
creating build\bdist.win32\winexe\collect
creating build\bdist.win32\winexe\collect\4
creating build\bdist.win32\winexe\collect\4\Scripts.py2exe
Searching modules needed to run '4.py' on path:
['D:\\projects\\fingerprinting\\build\\bdist.win32\ \winexe\\lib\\Python\\Li
b\\si
te-packages', '', 'D:\\Python\\Lib\\site-packages\\Pythonwin',
'D:\\Python\\Lib\
\site-packages\\win32', 'D:\\Python\\Lib\\site-packages\\win32\\lib',
'D:\\Pytho
n\\Lib\\site-packages', 'D:\\Python\\DLLs', 'D:\\Python\\lib',
'D:\\Python\\lib\
\lib-tk', 'D:\\Python', 'D:\\Python\\lib\\site-packages\\numarray']
force_imports =
Resolving binary dependencies:
D:\Python\lib\site-packages\numarray\_numarray.pyd
D:\Python\lib\site-packages\numarray\_operator.pyd
D:\Python\Lib\site-packages\py2exe\run.exe
D:\Python\Lib\site-packages\wxPython\utilsc.pyd
D:\Python\lib\site-packages\numarray\_conv.pyd
D:\Python\lib\site-packages\numarray\_bytes.pyd
D:\Python\lib\site-packages\numarray\_ufunc.pyd
D:\Python\lib\site-packages\numarray\_converter.pyd
D:\Python\Lib\site-packages\wxPython\wxmsw233h.dll
D:\Python\Lib\site-packages\wxPython\wxc.pyd
C:\WIN2000\System32\python22.dll
D:\Python\lib\site-packages\numarray\_ndarray.pyd
D:\Python\lib\site-packages\numarray\memory.pyd
D:\Python\lib\site-packages\numarray\_sort.pyd
D:\Python\Lib\site-packages\wxPython\wxmsw232h.dll
D:\Python\DLLs\_sre.pyd
ext_mapping = {
'_conv': ('_conv.pyd', ('.pyd', 'rb', 3))
'_ndarray': ('_ndarray.pyd', ('.pyd', 'rb', 3))
'_sort': ('_sort.pyd', ('.pyd', 'rb', 3))
'_converter': ('_converter.pyd', ('.pyd', 'rb', 3))
'_numarray': ('_numarray.pyd', ('.pyd', 'rb', 3))
'_ufunc': ('_ufunc.pyd', ('.pyd', 'rb', 3))
'_operator': ('_operator.pyd', ('.pyd', 'rb', 3))
'_bytes': ('_bytes.pyd', ('.pyd', 'rb', 3))
'memory': ('memory.pyd', ('.pyd', 'rb', 3))
'wxPython.utilsc': ('utilsc.pyd', ('.pyd', 'rb', 3))
'_sre': ('_sre.pyd', ('.pyd', 'rb', 3))
'wxPython.wxc': ('wxc.pyd', ('.pyd', 'rb', 3))
}
copying D:\Python\Lib\site-packages\py2exe\support.py ->
build\bdist.win32\winex
e\collect\4\Scripts.py2exe
byte-compiling D:\Python\lib\pre.py to pre.pyc
byte-compiling D:\Python\lib\__future__.py to __future__.pyc
byte-compiling D:\Python\lib\copy_reg.py to copy_reg.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\fonts.py to
wxPython\fonts.p
yc
byte-compiling D:\Python\Lib\site-packages\wxPython\windows.py to
wxPython\windo
ws.pyc
byte-compiling D:\Python\lib\locale.py to locale.pyc
byte-compiling D:\Python\lib\random.py to random.pyc
byte-compiling D:\Python\lib\popen2.py to popen2.pyc
byte-compiling D:\Python\lib\stat.py to stat.pyc
byte-compiling D:\Python\lib\imputil.py to imputil.pyc
byte-compiling D:\Python\lib\site-packages\numarray\_ufuncall.py to
_ufuncall.py
c
byte-compiling D:\Python\Lib\site-packages\wxPython\events.py to
wxPython\events
..pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\utils.py to
wxPython\utils.p
yc
byte-compiling D:\Python\lib\site-packages\numarray\arrayprint.py to
arrayprint.
pyc
byte-compiling D:\Python\lib\string.py to string.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\printfw.py to
wxPython\print
fw.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\misc.py to
wxPython\misc.pyc

byte-compiling D:\Python\lib\re.py to re.pyc
byte-compiling D:\Python\lib\tempfile.py to tempfile.pyc
byte-compiling D:\Python\lib\warnings.py to warnings.pyc
byte-compiling D:\Python\lib\site-packages\numarray\typeconv.py to
typeconv.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\streams.py to
wxPython\strea
ms.pyc
byte-compiling D:\Python\lib\sre_constants.py to sre_constants.pyc
byte-compiling D:\Python\lib\ntpath.py to ntpath.pyc
byte-compiling D:\Python\lib\sre_compile.py to sre_compile.pyc
byte-compiling D:\Python\lib\getopt.py to getopt.pyc
byte-compiling D:\Python\lib\site-packages\numarray\ufunc.py to ufunc.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\controls2.py to
wxPython\con
trols2.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\windows3.py to
wxPython\wind
ows3.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\stattool.py to
wxPython\stat
tool.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\controls.py to
wxPython\cont
rols.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\__version__.py to
wxPython\_
_version__.pyc
byte-compiling D:\Python\lib\UserDict.py to UserDict.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\wx.py to
wxPython\wx.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\sizers.py to
wxPython\sizers
..pyc
byte-compiling D:\Python\lib\repr.py to repr.pyc
byte-compiling D:\Python\lib\sre_parse.py to sre_parse.pyc
byte-compiling D:\Python\lib\copy.py to copy.pyc
byte-compiling D:\Python\lib\site-packages\numarray\numerictypes.py to
numericty
pes.pyc
byte-compiling D:\Python\lib\types.py to types.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\filesys.py to
wxPython\files
ys.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\windows2.py to
wxPython\wind
ows2.pyc
byte-compiling D:\Python\lib\dospath.py to dospath.pyc
byte-compiling D:\Python\lib\sre.py to sre.pyc
byte-compiling D:\Python\lib\site-packages\numarray\numarray.py to
numarray.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\misc2.py to
wxPython\misc2.p
yc
byte-compiling D:\Python\lib\site-packages\numarray\ndarray.py to
ndarray.pyc
byte-compiling D:\Python\lib\linecache.py to linecache.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\frames.py to
wxPython\frames
..pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\__init__.py to
wxPython\__in
it__.pyc
byte-compiling D:\Python\lib\posixpath.py to posixpath.pyc
byte-compiling D:\Python\lib\site-packages\numarray\numinclude.py to
numinclude.
pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\cmndlgs.py to
wxPython\cmndl
gs.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\image.py to
wxPython\image.p
yc
byte-compiling D:\Python\Lib\site-packages\wxPython\mdi.py to
wxPython\mdi.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\gdi.py to
wxPython\gdi.pyc
byte-compiling D:\Python\lib\os.py to os.pyc
byte-compiling D:\Python\Lib\site-packages\wxPython\clip_dnd.py to
wxPython\clip
_dnd.pyc
copying 4.py ->
build\bdist.win32\winexe\collect\4\Scripts.py2exe\ __main__.py
changing into 'build\bdist.win32\winexe\collect\4'
zip -rq D:\projects\fingerprinting\build\bdist.win32\winex e\4.zip .
creating 'D:\projects\fingerprinting\build\bdist.win32\wine xe\4.zip' and
adding
'.' to it
changing back to 'D:\projects\fingerprinting'
creating dist\4\4.exe
warning: py2exe: could not parse version number ''
No VersionInfo will be created
not copying D:\Python\lib\site-packages\numarray\_numarray.pyd (output up-
to-dat
e)
not copying D:\Python\lib\site-packages\numarray\_operator.pyd (output up-
to-dat
e)
not copying D:\Python\Lib\site-packages\wxPython\utilsc.pyd (output up-to-
date)
not copying D:\Python\lib\site-packages\numarray\_conv.pyd (output up-to-
date)
not copying D:\Python\lib\site-packages\numarray\_bytes.pyd (output up-to-
date)
not copying D:\Python\lib\site-packages\numarray\_ufunc.pyd (output up-to-
date)
not copying D:\Python\lib\site-packages\numarray\_converter.pyd (output up-
to-da
te)
not copying D:\Python\Lib\site-packages\wxPython\wxmsw233h.dll (output up-
to-dat
e)
not copying D:\Python\Lib\site-packages\wxPython\wxc.pyd (output up-to-
date)
not copying C:\WIN2000\System32\python22.dll (output up-to-date)
not copying D:\Python\lib\site-packages\numarray\_ndarray.pyd (output up-
to-date
)
not copying D:\Python\lib\site-packages\numarray\memory.pyd (output up-to-
date)
not copying D:\Python\lib\site-packages\numarray\_sort.pyd (output up-to-
date)
not copying D:\Python\Lib\site-packages\wxPython\wxmsw232h.dll (output up-
to-dat
e)
not copying D:\Python\DLLs\_sre.pyd (output up-to-date)
warning: py2exe:
************************************************** *************
**********
warning: py2exe: * The following modules were not found:
warning: py2exe: * cmndlgsc
warning: py2exe: * imagec
warning: py2exe: * clip_dndc
warning: py2exe: * windows3c
warning: py2exe: * filesysc
warning: py2exe: * eventsc
warning: py2exe: * windows2c
warning: py2exe: * controlsc
warning: py2exe: * misc2c
warning: py2exe: * os.path
warning: py2exe: * windowsc
warning: py2exe: * stattoolc
warning: py2exe: * printfwc
warning: py2exe: * gdic
warning: py2exe: * sizersc
warning: py2exe: * mdic
warning: py2exe: * fontsc
warning: py2exe: * streamsc
warning: py2exe: * miscc
warning: py2exe: * controls2c
warning: py2exe: * framesc
warning: py2exe:
************************************************** *************
**********
removing 'build\bdist.win32\winexe\collect\4' (and everything under it)
Built File dist\4\4.exe
removing 'build\bdist.win32\winexe' (and everything under it)
Jul 18 '05 #1
0 2959

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Will | last post by:
Maybe there is another group for posting this... I am a total newbie to Python... so please forgive me if I ask a bunch of inappropriate questions... as I am a big question asker. If I develope...
2
by: Marc Schellens | last post by:
Following the NumPy documentation, I took over some C code, but run into an error. Does anybody have a suggestion? Thanks, marc gdlpython.cpp:225: `PyArray_Type' undeclared (first use this...
1
by: youngdubliner | last post by:
I'm having a problem ........ I've stripped all my code to help isolate the problem. Its seems to be with importing numarray when python is embedded in C. I have a simple C program it Opens...
5
by: Bill Mill | last post by:
Hello all, I've pickled a numarray array object using cPickle like so: pickle = cPickle.Pickler(fout, -1) pickle.dump((myarray, list1, list2)) and this seems to work fine, until I try to...
2
by: maxwell | last post by:
I'm trying to use the 'numarray' package (v1.1.1) under Python 2.4 running under CygWin. I initially downloaded the Windows executable version of the numarray package, and installed it under...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
4
by: jeg | last post by:
dear all, i'm an astronomer working with 2d images -- 2d numarrays. i have a script which basically does some operations on some images, and one of the first steps is to find a galaxy on an...
0
by: andrewfelch | last post by:
Below is the code to/from Boolean arrays and Unsigned integers. On my Pentium 4, functions such as "bitwise_and" are 32 times faster when run on 32-bit integers instead of the...
4
by: bwaha | last post by:
First time trying to create an executable with py2exe. I have a small program which makes use of python23 (2.3.5?), wxpython ('2.6.2.1'), matplotlib ('0.83.2'), win32com (latest?), Numeric...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.