There is an annoying bug when using wxAgg backend with wxPython 2.8 on 
Windows. Whenever matplotlib is imported, we get a modal message box 
displaying the error message:

"This application has failed to start because wxmsw26uh_vc.dll was not 
found. Reinstalling the application may fix this problem."

After clicking OK, everything works fine.


Here is a bugfix:


_wxagg.pyd has a dependency on a unicode version of a "hybrid" (i.e. 
debug) wxWidgets library, wxmsw26uh_vc.dll. I verified this using MSVC 
dumpbin utility. No users of wxPython 2.8 will have this dll installed.

At the bottom of the file backends_wxagg.py, there is an import 
statement for _wxagg.pyd:

try:
     import _wxagg
except ImportError:
     _wxagg = None

Obviously this import always fails on wxPython 2.8, and is the cause of 
the redundant error message. _wxagg.pyd is not needed with wxPython 2.8, 
so the import should not be attempted at all. Python will trap the 
ImportError exception, but a redundant error message is displayed.

Instead, it should read like this:

if getattr(wx, '__version__', '0.0')[0:3] < '2.8':
     try:
         import _wxagg # C++ accelerator with wxPython 2.6
     except ImportError:
         _wxagg = None # default to pure Python
else: # wxPython 2.8, no accelerator needed
     _wxagg = None


On wxPython 2.6, the C++ accelerator in _wxagg.pyd will not be used 
unless _wxagg.pyd is linked against the xwWidgets library actually 
present, and Python will default to Python code instead. Fixing these 
issues on wxpython 2.6 thus require a rebuild of _wxagg.pyd that links 
it with the wx library present on the system.

If all you need is to get rid of the error message, just comment out the 
import statement and set the global variable _wxagg to None.


Regards,

Sturla Molden


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to