diff --git a/rdkit/Chem/Draw/IPythonConsole.py b/rdkit/Chem/Draw/IPythonConsole.py index c0aa006e6..dd62df897 100644 --- a/rdkit/Chem/Draw/IPythonConsole.py +++ b/rdkit/Chem/Draw/IPythonConsole.py @@ -73,7 +73,15 @@ None''' else: # py3Dmol does not currently support v3k mol files, so # we can only provide those with "smaller" molecules - mb = Chem.MolToMolBlock(mol, confId=confId) + try: + mb = Chem.MolToMolBlock(mol, confId=confId) + except Chem.AtomKekulizeException: + # The bonding is likely to be wrong, but it would be good + # to see something. + p = Chem.rdmolfiles.MolWriterParams() + p.kekulize = False + mb = Chem.MolToMolBlock(mol, confId=confId, params=p) + view.addModel(mb, 'sdf') if drawAs is None: drawAs = drawing_type_3d @@ -545,3 +553,4 @@ def UninstallIPythonRenderer(): InstallIPythonRenderer() +