Registry / ai-ml / rdkit-pypi

rdkit-pypi

JSON →
library2022.9.5pypypiunverified

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.

pip install rdkit-pypi
INSTALL
IMPORT
SIG · RDKIT-PYPI
R
rdkit-pypi
ai-mlpythonv2022.9.5
Install
5.8s avg
Import
320ms
Disk
218MB
Pass rate
3/ 10
Env Coverage3 / 10
glibc
3.93.13
musl
3.93.13
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
musl
glibc
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.
fix
Always 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.
fix
Use 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.
fix
Consult 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.
fix
Optimize 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.

Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
rdkit-pypi — pip install rdkit-pypi · libregistry