In SMILES I would think that $\ce{XeF6}$ would be F[Xe](F)(F)(F)(F)F or F[Xe](F)(F)(F)(F)(F). A quick Wikipedia search showed that the first result is the correct SMILES string. However, rdkit isn't able to convert either SMILES strings into a structure.

Here is my code:

from IPython.display import SVG
from rdkit import Chem
from rdkit.Chem import rdDepictor
from rdkit.Chem.Draw import rdMolDraw2D
# Create mol object from smiles string
# mol = Chem.MolFromSmiles('[B](C7OC7)(CCC3CCCC31N2CN([P]5CCCC8C5)C2(CO8)CC1)(C6CCC6)')
# The above molecule was me learning SMILES, below is the Xenon Hexafluoride string
mol = Chem.MolFromSmiles('F[Xe](F)(F)(F)(F)')
mc = Chem.Mol(mol.ToBinary())
if not mc.GetNumConformers():
    #Compute 2D coordinates
# init the drawer with the size
drawer = rdMolDraw2D.MolDraw2DSVG(molSize[0],molSize[1])
#draw the molcule
# get the SVG string
svg = drawer.GetDrawingText()
# fix the svg string and display it
  • 3
    $\begingroup$ You may want to post this question in Matter Modeling SE instead which is well suited to answer such questions. If you do decide to migrate the question please delete the current one. Good luck! $\endgroup$
    – Buck Thorn
    Feb 5, 2021 at 9:29
  • 3
    $\begingroup$ Missing the sixth F? $\endgroup$
    – Andrew
    Feb 5, 2021 at 11:44
  • $\begingroup$ Oh yeah Andrew you're right (doesn't fix issue though) and will do Buck Thorn. $\endgroup$ Feb 5, 2021 at 20:28
  • 1
    $\begingroup$ With the last version of RDKit (2020.09) it works for me. $\endgroup$
    – rapelpy
    Feb 6, 2021 at 6:24
  • 1
    $\begingroup$ @SohilKollipara If you are still interested in this or found an answer since then, you can copy the question to Matter Modeling and remove the version here. $\endgroup$
    – Tyberius
    Jan 11, 2022 at 18:04

1 Answer 1


If you start with RDKit, I suggest to work through the examples of RDKit's cookbook. With minor adjustments, paste the following into a cell of a Jupyter notebook as a minimal, self sufficient working example (MWE)

from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem import Draw

mol = Chem.MolFromSmiles("F[Xe](F)(F)(F)(F)F")

to obtain the following illustration:

enter image description here

The setup used: Jupyter 6.4.5, Python 3.9.9, RDKit 2021.09.2 as currently repackaged e.g., by Linux Debian 12/bookworm, branch testing (package tracker). Stay tuned to the project's GitHub page to know if there is a new release (currently 2021.09.4, just two days old) more frequently packaged for conda.

There is something odd with the code provided by you. Copy-pasted into the same Jupyter notebook, the molecule plot contains a dot about an unpaired electron:

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.