RDKit for Python (PyPI)

2026.03.01 · active · verified Fri Apr 17

RDKit is a collection of chemoinformatics and machine-learning software written in C++ and Python. The `rdkit-pypi` package provides pre-built wheels for the RDKit library, enabling easy installation via pip on various platforms and Python versions. This addresses common build issues encountered with the upstream RDKit PyPI package, which often only provides source distributions. It follows a rapid release cadence, syncing with RDKit's development.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates how to create RDKit molecule objects from SMILES strings, convert them back to SMILES, and visualize them as a grid image. Ensure you have matplotlib and pillow installed for image generation.

from rdkit import Chem
from rdkit.Chem.Draw import MolsToGridImage

# Create a molecule from SMILES string
mol1 = Chem.MolFromSmiles('CCO')
mol2 = Chem.MolFromSmiles('c1ccccc1')

print(f"SMILES for ethanol: {Chem.MolToSmiles(mol1)}")
print(f"SMILES for benzene: {Chem.MolToSmiles(mol2)}")

# Generate an image grid (requires matplotlib and pillow, often pre-installed)
img = MolsToGridImage([mol1, mol2], molsPerRow=2, subImgSize=(200, 200))
# In a Jupyter environment, img would display directly
# If not in Jupyter, you might save it: img.save('molecules.png')

view raw JSON →