![]() |
py2exe with matplotlib
I'm trying to compile my Python program (just 2 files) with py2exe. It uses a number of modules, including wx, matplotlib, and numeric. After some tweaking, I got py2exe to produce the executable, however, I get the following error message whenever I run it:
:
import core -> failed: No module named _internal |
When you were compiling, did you mention both files inside the setup file? If you only specify one, I don't think it searches for any imports in the second file, even if the first imports the second.
|
Thanks, Sane, but I'm not sure what you mean (ie, how do you specify a second source file?). I'm pretty sure that's not the problem though, I think it has something to do with importing the matplotlib/numeric module(s). I keep getting this _ARRAY_API error.
I've tried reinstalling matplotlib and numeric, and even installing scipy; however, nothing seems to make any difference. I really need this to work, so any help would be greatly appreciated! :
Traceback (most recent call last): |
Well, you said there was a second file. I assumed you were importing those modules indirectly through the second file. And if you read my last post, you would see why that could be causing the error you currently see.
To specify the second file, I believe you make it another item in the console key. Check the py2exe model setup scripts. |
The docs say it looks for everything it needs, including modules in other files, etc. I tried it, and I just got two executables, neither of which work. Thanks anyway.
|
I may have to resort to not using matplotlib (which requires numeric). Does anyone know of an alternative free plotting package to matplotlib? I need only basic plotting capabilities.
|
Have you gotten a pure wxPython program to be packaged with py2exe (nothing is really complied)? After you got that out of way look up the docs of py2exe for how modules that have native code (ie dll files) are used with py2exe. It looks as if numeric can't find the C based dll that it needs in order to run.
|
You might be right; I was excluding a bunch of dll files that I didn't want to bother downloading. However, I downloaded, installed, and included all the dll files but one, and sadly I get the same error. If you're right, the problem could be that I didn't install the one dll file it needed (unlikely, but possible?), which is wxmsw26uh_vc.dll. I've searched all over for this file but it seems to be impossible to find. If anyone could help me out here, it would be great.
|
You should also look into the wxPython forums on how to package wxPython with py2exe, they have some instructions. From the looks of that dll it is wxWidgets 2.6, compiled for windows with unicode enabled and the VC++ compiler. I don't know what the h is. You must have the wxWidgets dll if you want wxPython to work.
|
I commented out the parts of my code that use matplotlib, and py2exe works fine. So the problem is with matplotlib, not wxPython. I'm still not sure what to do.
This is the setup.py file I'm using: :
# setup.py |
| All times are GMT -5. The time now is 9:46 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC