From: Rob M. <rob...@in...> - 2005-10-19 10:14:11
|
Thanks Werner.. Werner F. Bruhin wrote: > Hi Rob, > > Rob Marino wrote: > >> Suddenly I feel less alone. >> >> .. >> I'm engaged in exactly the same process right now, I've tried moving >> the whole of numarray into the dist a dir out of sheer >> desperation....but no go- my traceback looks like this..... >> >> Traceback (most recent call last): >> Traceback (most recent call last): >> File "HacGui.py", line 21, in ? >> File "activity.pyc", line 17, in ? >> File "matplotlib\axes.pyc", line 5, in ? >> File >> "C:\DOCUME~1\ROBMAR~1\REPO\Hydra2\hydra\admin\client\HAC\build\dist\__init__.pyc", >> line 95, in ? >> >> ImportError: No module named random_array > > If I remember correctly I had solved that by including > "matplotlib.numerix" into the packages to force include in py2exe. > > "packages": ["encodings", "kinterbasdb", "pytz", "matplotlib.numerix"], > > See you > Werner > >> >> As soon as I remove numarray fropm the dist dir this resolves to >> >> >> Fatal Python error: Call to API function without first calling >> import_libnumarray() in Src\_convmodule.c >> >> I came across a post yesterday >> http://aspn.activestate.com/ASPN/Mail/Message/numpy-discussion/2852995 >> that suggests that it's possible to >> 'force' the whole of numarray into an app. I'd like to know how though >> >> *Russell E. Owen wrote: > If I convert my python code to an >> application (Windows via py2exe or Mac > via bundlebuilder) it fails >> with the following error: > > Fatal Python error: Call to API >> function without first calling > import_libnumarray() in >> Src/_convmodule.c > > This currently (1.3.3) happens when a numarray >> API function is called before the API is successfully initialized. >> Although the message was intended as an aid to extension writers, in >> this case numarray is failing to import altogether. At one point >> numarray had a fatal error for import failures but I removed it at >> someone's request. I've restored it because I think it's most >> commonly fatal anyway and removing the message just obfuscated the >> problem. The non-fatal behavior is now in the _import_libnumarray() >> macro. > I can force *all* of numarray into the application, which >> avoids the > > This is what you need to do. It should be possible to >> factor out (or not explicitly list) numarray's Packages, but core >> numarray is not meant to be distributed in pieces. The many >> type-specific extensions were only added to work around a compiler >> problem, not to lighten binary distributions. ..* >> >> >> >> >> ('.', >> glob.glob(r'C:\PROGRA~1\Python24\share\MATPLO~1\matplotlibrc')), >> ('.', >> glob.glob(r'C:\PROGRA~1\Python24\Lib\SITE-P~1\numarray\*.py')), >> >> ......seems to take care of an earlier error ( can't find >> matplotlibrc file) >> >> You have my complete empathy on this problem. In the event I come up >> with some sort of magic bullet, I'll mail you ASAP. >> >> Have fun :-) >> >> Rob M. >> >> >> >> Tim Burgess wrote: >> >>> Hi, >>> Still tryin' to freeze my wxmpl matplotlib application.... sigh. >>> >>> This is wxpython + wxmpl + matplotlib. This has turned into one hell >>> of a fight - BUT I think I am about to win. You have to keep the >>> faith :-} >>> >>> Name the py2exe issue with freezing matplotlib / wxmpl and I have >>> been there fought that. I have slayed many dragons... >>> >>> I now have a problem that has been asked before on this list. I have >>> tried the answer that was offered- it didnt help. I think I am in a >>> postion to ask a simple solid question... >>> >>> When I run my application I see this.... >>> >>> Fatal Python error: Call to API function without first calling >>> import_libnumarray() in Src\_convmodule.c >>> >>> This application has requested the Runtime to terminate it in an >>> unusual way. >>> Please contact the application's support team for more information. >>> >>> I added import numarray all over the place... a previous post >>> suggested that maybe Wxpython was calling numarray before I was... >>> no I dont think wxpython and numarray ever need each other. >>> >>> To help prove this I changed my application to this: (a boa app - so >>> this code occurs early in execution but not before wxpython has been >>> used... >>> >>> def __init__(self, parent): >>> >>> import numarray >>> import numarray.numarrayall # desperate attempt to stop error >>> api call without first calling import_libnumarray >>> self._init_ctrls(parent) # init wxpython controls >>> >>> print numarray.__version__ >>> >>> and bang my application no longer runs. If I comment out this print >>> line, the application runs perfectly except when you click the >>> button to draw the graph. Then you get the same error message as above. >>> >>> BTW in the development environments - application works fine - and >>> that's because the development environs are loading the modules from >>> the python installation - is my call... >>> >>> In my library file you can see that numarray is definitely included >>> - it's there. >>> >>> So my question is: >>> Q: How do you force the loading (not the inclusion) of the nummary >>> module? Or how do you get import_libnumarray to run? >>> >>> Can some one tell me more about the mechanism python uses to load >>> the modules.. What triggers the load call? Where? >>> >>> I know I am close. Rest of the application is 95% finished. Customer >>> loves it. 2 week delay coz I cant freeze the @#$@$%@ thing. >>> >>> BTW kudos to py2exe developers and maintainers - as I learn more >>> about the challenges in identifying the modules and the packaging of >>> them etc - I appreciate it. This is not a sucking up effort to get >>> an answer - but if it helps.... :-} >>> >>> thanks >>> >>> PS I have cross posted this to matploblib and py2exe lists - I am >>> desperate! >>> >> >> -- >> O__ >> _/`.\ >> `=( ' >> >> >> ------------------------------------------------------- This SF.Net >> email is sponsored by: Power Architecture Resource Center: Free >> content, downloads, discussions, and more. >> http://solutions.newsforge.com/ibmarch.tmpl > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Py2exe-users mailing list > Py2...@li... > https://lists.sourceforge.net/lists/listinfo/py2exe-users > > -- O__ _/`.\ `=( ' |