<div class="gmail_quote">On Thu, Aug 30, 2012 at 4:02 PM, Jonno <span dir="ltr"><<a href="mailto:jonnojohnson@gmail.com" target="_blank">jonnojohnson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br></div></div><div>Well I managed to figure out that the first traceback is the one causing the problem and that matplotlib/mathtext in my app is the problem.</div><div>Now to figure out how to get mathtext working.</div>

</blockquote></div><br><div>Bit more information:</div><div>I am also seeing warnings in app.exe.log:</div><div><div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['STIXGeneral'] not found. Falling back to Bitstream Vera Sans</div>
<div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1226: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=12. Returning c:\windows\fonts\browai.ttf</div>
<div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['STIXSizeOneSym'] not found. Falling back to Bitstream Vera Sans</div><div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1226: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=normal:variant=normal:weight=bold:stretch=normal:size=12. Returning c:\windows\fonts\browai.ttf</div>
<div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['STIXSizeThreeSym'] not found. Falling back to Bitstream Vera Sans</div><div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['STIXSizeFourSym'] not found. Falling back to Bitstream Vera Sans</div>
<div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['STIXSizeFiveSym'] not found. Falling back to Bitstream Vera Sans</div><div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['STIXSizeTwoSym'] not found. Falling back to Bitstream Vera Sans</div>
<div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1226: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=italic:variant=normal:weight=normal:stretch=normal:size=12. Returning c:\windows\fonts\browai.ttf</div>
<div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['STIXNonUnicode'] not found. Falling back to Bitstream Vera Sans</div><div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['cmb10'] not found. Falling back to Bitstream Vera Sans</div>
<div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['cmtt10'] not found. Falling back to Bitstream Vera Sans</div><div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['cmmi10'] not found. Falling back to Bitstream Vera Sans</div>
<div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['cmex10'] not found. Falling back to Bitstream Vera Sans</div><div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['cmsy10'] not found. Falling back to Bitstream Vera Sans</div>
<div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['cmr10'] not found. Falling back to Bitstream Vera Sans</div><div>C:\Users\Administrator\Desktop\dist\library.zip\matplotlib\font_manager.py:1216: UserWarning: findfont: Font family ['cmss10'] not found. Falling back to Bitstream Vera Sans</div>
</div><div><br></div><div>I think these are all fonts that matplotlib/mathtext would use so it makes sense that the traceback ends with:</div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
File "matplotlib\mathtext.pyo", line 720, in _get_glyph</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">KeyError: 98</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I then discovered that both the methods I tried for getting data_files (using glob and matplotlib.get_py2exe_datafiles) were not working and I had nothing in my mpl-data/fonts directory. This directory should contain 3 folders: afm, pdfcorefonts & ttf. The ttf folder is where the mathtext fonts mentioned above are located.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
I then tried manually copying the entire mpl-data folder into the dist folder after running py2exe on setup.py but still I get the same error.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Does data_files do anything other than include files and directories in the dist folder?</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div>