I'm using rdkit.
After a build using py2exe
, when I call the Draw.MolToImage
method there is an error:
Warning: unable to load font metrics from dir
C:\pythonApp\dist\library.zip\rd
kit\sping\PIL\pilfonts
Traceback (most recent call last):
File "app.py", line 470, in <module>
img=Draw.MolToImage(part[i])
File "rdkit\Chem\Draw\__init__.pyc", line 124, in MolToImage
File "rdkit\Chem\Draw\MolDrawing.pyc", line 536, in AddMol
File "rdkit\Chem\Draw\MolDrawing.pyc", line 351, in _drawLabel
File "rdkit\Chem\Draw\spingCanvas.pyc", line 74, in addCanvasText
File "rdkit\sping\PIL\pidPIL.pyc", line 333, in drawString
ValueError: bad font: Font(12,0,0,0,'helvetica')`
There is no difference if I put these files into library.zip
(to \rdkit\sping\PIL\pilfonts
) or just into the dist
folder and change paths in pidPIL.py
to valid; the application still cannot open metrics.dat
.
Without the py2exe
conversion, everything works perfectly.