Install & Compatibility
Where this runs
tested against v2022.9.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.10
✕ build_error
✓ 5.55s
py 3.11
✕ build_error
✓ 5.15s
py 3.12
✕ build_error
✕ build_error
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
✓ 6.75s
218MB installed
● package 218MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Chem
✓ from rdkit import Chem
AllChem
✓ from rdkit.Chem import AllChem
DataStructs
✓ from rdkit import DataStructs
MolsToGridImage
✓ from rdkit.Chem.Draw import MolsToGridImage
✗ from rdkit.Chem import MolsToGridImage
Drawing utilities are typically in rdkit.Chem.Draw
IPythonConsole
✓ from rdkit.Chem.Draw import IPythonConsole
Required to render molecules directly in Jupyter notebooks; often imported for side effects.
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')
Debug
Known issues
gotchaMany users incorrectly attempt to install the upstream `rdkit` package directly via `pip install rdkit`. The official `rdkit` package on PyPI typically only provides source distributions, leading to build errors without specific C++ dependencies and compilers. The `rdkit-pypi` package provides pre-built wheels, making `pip install rdkit-pypi` the recommended method for pip users.fixAlways use `pip install rdkit-pypi` for easy installation with pre-built wheels.
affects: All versions
gotchaMixing RDKit installations (e.g., `conda install rdkit` and `pip install rdkit-pypi`) in the same Python environment can lead to linker errors, module conflicts, or unexpected behavior due to different underlying C++ libraries.fixUse a dedicated virtual environment and stick to a single installation method (either `conda` or `pip install rdkit-pypi`).
affects: All versions
breakingThe RDKit API can evolve between major releases, leading to deprecations or changes in function signatures, class constructors, or module locations. `rdkit-pypi` versions closely track RDKit releases, so these changes apply.fixConsult the official RDKit release notes and migration guides when upgrading across major RDKit versions. Test your code thoroughly after upgrades.
affects: All major RDKit release boundaries (e.g., 2023.09.x to 2024.03.x)
gotchaProcessing very large molecules, extensive conformer generation, or high-throughput calculations/drawing without proper memory management can lead to significant memory consumption and potential `MemoryError` or `Segmentation fault` crashes.fixOptimize your code for memory efficiency, process data in batches, and ensure your system has sufficient RAM for computationally intensive tasks. Consider using RDKit's C++ API for extreme cases or distributed computing.
affects: All versions
Upgrade
Version history
2022.9.5latest on PyPI · released Feb 26, 2023
Audit
Dependencies
No dependency data recorded yet.