{"id":27686,"library":"deepchem","title":"DeepChem","description":"DeepChem is a Python library for deep learning in drug discovery, quantum chemistry, and the life sciences. It provides molecular featurization, model building, and dataset handling, supporting both TensorFlow and PyTorch backends. Current stable version is 2.8.0, with approximately bi-annual releases.","status":"active","version":"2.8.0","language":"python","source_language":"en","source_url":"https://github.com/deepchem/deepchem","tags":["deep-learning","drug-discovery","cheminformatics","molecular-modeling","computational-chemistry"],"install":[{"cmd":"pip install deepchem","lang":"bash","label":"CPU version"},{"cmd":"pip install deepchem[gpu]","lang":"bash","label":"GPU version (CUDA 10)"}],"dependencies":[{"reason":"Primary deep learning framework dependency for many models and layers.","package":"tensorflow","optional":false},{"reason":"Alternative backend for models ported to PyTorch (e.g., GCN, AttentiveFP).","package":"pytorch","optional":true},{"reason":"Required for molecular featurization and cheminformatics.","package":"rdkit","optional":false}],"imports":[{"note":"Wildcard import is discouraged; use 'import deepchem as dc' for namespace clarity.","wrong":"from deepchem import *","symbol":"deepchem","correct":"import deepchem as dc"},{"note":"Module is 'feat' not 'featurizers' in recent versions.","wrong":"from deepchem.featurizers import *","symbol":"Featurizer classes","correct":"from deepchem.feat import MolGraphConvFeaturizer"}],"quickstart":{"code":"import deepchem as dc\n\n# Load a dataset from MoleculeNet\ntasks, datasets, transformers = dc.molnet.load_delaney(featurizer='GraphConv')\ntrain_dataset, valid_dataset, test_dataset = datasets\n\n# Define a graph convolutional model\nmodel = dc.models.GraphConvModel(n_tasks=len(tasks), mode='regression', dropout=0.2)\n\n# Fit the model on training data\nmodel.fit(train_dataset, nb_epoch=10)\n\n# Evaluate on test set\nmetric = dc.metrics.Metric(dc.metrics.pearson_r2_score)\nscores = model.evaluate(test_dataset, [metric])\nprint(scores)","lang":"python","description":"Minimal example: load Delaney solubility dataset, train a GraphConv model, and evaluate with Pearson R²."},"warnings":[{"fix":"All models now use Keras layers. TensorGraph classes have been removed.","message":"DeepChem 2.4.0 dropped TensorGraph and moved to Keras-based models. Models built with older versions will not work without migration.","severity":"breaking","affected_versions":">=2.4.0"},{"fix":"Use Python 3.7–3.11. Downgrade Python or use a virtual environment with supported version.","message":"DeepChem 2.8.0 requires Python <3.12. Installation on Python 3.12 will fail.","severity":"breaking","affected_versions":"2.8.0"},{"fix":"Use the specific model import (e.g., 'from deepchem.models import GCNModel') and ensure required backend is installed. For PyTorch models, install PyTorch separately.","message":"Default backend between TensorFlow and PyTorch is not always clear. Some models (e.g., GraphConvModel) are TensorFlow only, while others (e.g., GCNModel) exist in both. Check documentation for backend compatibility.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'from deepchem.feat import MolGraphConvFeaturizer' instead.","message":"The legacy featurizer classes like 'CircularFingerprint' are deprecated in favor of graph-based featurizers (e.g., 'MolGraphConvFeaturizer').","severity":"deprecated","affected_versions":">=2.6.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Update import to 'from deepchem.feat import MolGraphConvFeaturizer' or use 'from deepchem.feat.graph_data import GraphData'.","cause":"The 'graph_features' submodule was removed in DeepChem 2.7.0, with graph featurizers moved to 'deepchem.feat.graph_data' or directly to 'deepchem.feat'.","error":"ModuleNotFoundError: No module named 'deepchem.feat.graph_features'"},{"fix":"Access features via 'graph_data.node_features.shape[1]' instead of 'graph_data.num_node_features'.","cause":"In newer versions of DeepChem, the attribute was renamed or restructured. Old code expecting a direct attribute fails.","error":"AttributeError: 'GraphData' object has no attribute 'num_node_features'"},{"fix":"Use 'from deepchem.molnet import load_delaney' (still exists) or check if the dataset is available via 'dc.molnet.load_delaney()'. If not found, use the new API: 'from deepchem.molnet import load_delaney' (same). Actually, this error often occurs due to mismatched versions; for 2.8.0, it should be present. If not, try using 'deepchem.molnet.load_delaney'.","cause":"The 'load_delaney' function was removed or moved. MoleculeNet loaders are now organized differently in DeepChem 2.8.0.","error":"ImportError: cannot import name 'load_delaney' from 'deepchem.molnet'"},{"fix":"Install RDKit via conda: 'conda install -c conda-forge rdkit' (recommended) or pip: 'pip install rdkit-pypi' (may have issues).","cause":"RDKit is a required dependency for molecular featurization, but not automatically installed with pip. Missing RDKit causes this error.","error":"ValueError: Graph convolution requires RDKit to be installed."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}