Dear RDKitters, on a newly installed machine (OpenSuse 11.4, 64bit), I run into this issue: " File "rdkit_smi2png.py", line 12, in <module> Draw.MolToImageFile(mol, outF) File "/SW/python/x86_64_cs4/2.7/lib/python2.7/site-packages/rdkit/Chem/Draw/__init__.py", line 142, in MolToImageFile img = MolToImage (mol,size=size,kekulize=kekulize,wedgeBonds=wedgeBonds,**kwargs) File "/SW/python/x86_64_cs4/2.7/lib/python2.7/site-packages/rdkit/Chem/Draw/__init__.py", line 82, in MolToImage drawer.AddMol(mol,**kwargs) File "/SW/python/x86_64_cs4/2.7/lib/python2.7/site-packages/rdkit/Chem/Draw/MolDrawing.py", line 463, in AddMol self._drawLabel(symbol, pos, font, color=color,orientation=orient) File "/SW/python/x86_64_cs4/2.7/lib/python2.7/site-packages/rdkit/Chem/Draw/MolDrawing.py", line 279, in _drawLabel self.canvas.addCanvasText(label,(x1,y1),font,color,**kwargs) File "/SW/python/x86_64_cs4/2.7/lib/python2.7/site-packages/rdkit/Chem/Draw/spingCanvas.py", line 82, in addCanvasText self.canvas.drawString(text,labelP[0],labelP[1],font,color=color) File "/SW/python/x86_64_cs4/2.7/lib/python2.7/site-packages/rdkit/sping/PIL/pidPIL.py", line 331, in drawString if not pilfont: raise "bad font!", font TypeError: exceptions must be old-style classes or derived from BaseException, not str "
Here comes the code: " if __name__=='__main__': import sys from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import Draw smi = open(sys.argv[1]).readlines()[0].rstrip() outF = sys.argv[2] mol = Chem.MolFromSmiles(smi) AllChem.Compute2DCoords(mol) Draw.MolToImageFile(mol, outF) " There are a few PIL threads on the mailing list, but none of them mentions the pilfont error.. Cheers & Thanks, Paul This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person. If you have received this transmission in error, please notify the sender immediately and delete the message and any attachment from your system. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept liability for any omissions or errors in this message which may arise as a result of E-Mail-transmission or for damages resulting from any unauthorized changes of the content of this message and any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not guarantee that this message is free of viruses and does not accept liability for any damages caused by any virus transmitted therewith. Click http://www.merckgroup.com/disclaimer to access the German, French, Spanish and Portuguese versions of this disclaimer. ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss