From: John H. <jdh...@ac...> - 2005-04-12 14:13:03
|
>>>>> "Michael" == Michael Twomey <mic...@gm...> writes: Michael> C:\temp\py2exe\simple_plot_gtk\dist>date_demo.exe Fatal Michael> Python error: Call to API function without first calling Michael> import_libnumarra y() in Src\_convmodule.c I saw the exact same thing but it appeared to come and go as I made minor tweaks to the setup, and could never figure out why I sometimes got this error and sometimes did not. I added nummaray to the packages list. Michael> (I also had to copy in the lib and etc directories from Michael> my GTK install to keep GTK+ happy, since it needs Michael> supporting files and libraries, that's a pygtk/GTK+ Michael> specific thing.) Yep, this is mentioned in the comment header of setup.py for the gtk example (and in the FAQ). Still, it's easy to miss, as I spent about 15 minutes trying to figure out what was going wrong (it had been many months since I wrote the example) before I read my own comment. I added a print reminder to setup.py. Michael> Even when I remove the pytz imports from the Michael> simple_plot_gtk scripts py2exe doesn't seem to have any Michael> problems, the pytz package include does the trick for me. Curious to know if this works for Andrea too. It appears to work for me with py2exe 0.5.4 Michael> I've attached a diff showing the minor modifications I Michael> made. Thanks, I've updated the examples on the site. I also saw your comment on the py2exe matplotlib wiki. I changed the init method slightly -- could you test this on your setup to make sure it works if sys.platform=='win32' and sys.frozen: path = os.path.join(os.path.split(sys.path[0])[0], 'matplotlibdata') if os.path.isdir(path): return path else: # Try again assuming sys.path[0] is a dir not a exe path = os.path.join(sys.path[0], 'matplotlibdata') if os.path.isdir(path): return path raise RuntimeError('Could not find the matplotlib data files') Thanks, JDH |