Install RDKit in an Anaconda Environment

This section provides a tutorial example on how to install RDKit Python library in an Anaconda environment. It's easy and fast.

The easiest and fastest way to install RDKit is to use the Anaconda package manager. Here is what I did to install RDKit with Anaconda on my Linux computer.

1. Make sure that Anaconda is installed.

herong$ conda --version
  conda 4.10.3

2. Creating a new Conda environment with the RDKit installed with one single command. This will take several minutes.

$ conda create -c conda-forge -n my-rdkit-env rdkit

Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##
  environment location: /usr/local/anaconda3/envs/my-rdkit-env
  added / updated specs:
    - rdkit

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    _libgcc_mutex-0.1          |      conda_forge           3 KB
    _openmp_mutex-4.5          |            1_gnu          22 KB
    boost-1.74.0               |   py39h5472131_3         368 KB
    boost-cpp-1.74.0           |       h312852a_4        16.3 MB
    bzip2-1.0.8                |       h7f98852_4         484 KB
    cairo-1.16.0               |    h6cf1ce9_1008         1.5 MB
    certifi-2021.5.30          |   py39hf3d152e_0         141 KB
    cycler-0.10.0              |             py_2           9 KB
    fontconfig-2.13.1          |    hba837de_1005         357 KB
    freetype-2.10.4            |       h0708190_1         890 KB
    gettext-0.19.8.1           |    h0b5b191_1005         3.6 MB
    greenlet-1.1.1             |   py39he80948d_0          83 KB
    jbig-2.1                   |    h7f98852_2003          43 KB
    jpeg-9d                    |       h36c2ea0_0         264 KB
    kiwisolver-1.3.1           |   py39h1a9c180_1          80 KB
    lcms2-2.12                 |       hddcbb42_0         443 KB
    ld_impl_linux-64-2.36.1    |       hea4e1c9_2         667 KB
    lerc-2.2.1                 |       h9c3ff4c_0         213 KB
    libblas-3.9.0              |11_linux64_openblas        12 KB
    libcblas-3.9.0             |11_linux64_openblas        11 KB
    libdeflate-1.7             |       h7f98852_5          67 KB
    libffi-3.3                 |       h58526e2_2          51 KB
    libgcc-ng-11.1.0           |       hc902ee8_8         908 KB
    libgfortran-ng-11.1.0      |       h69a702a_8          19 KB
    libgfortran5-11.1.0        |       h6c583b3_8         1.7 MB
    libglib-2.68.4             |       h3e27bee_0         3.0 MB
    libgomp-11.1.0             |       hc902ee8_8         427 KB
    libiconv-1.16              |       h516909a_0         1.4 MB
    liblapack-3.9.0            |11_linux64_openblas        11 KB
    libopenblas-0.3.17         |pthreads_h8fe5266_1       9.2 MB
    libpng-1.6.37              |       h21135ba_2         306 KB
    libstdcxx-ng-11.1.0        |       h56837e0_8         4.2 MB
    libtiff-4.3.0              |       hf544144_1         668 KB
    libuuid-2.32.1             |    h7f98852_1000          28 KB
    libwebp-base-1.2.1         |       h7f98852_0         845 KB
    libxcb-1.13                |    h7f98852_1003         395 KB
    libxml2-2.9.12             |       h72842e0_0         772 KB
    lz4-c-1.9.3                |       h9c3ff4c_1         179 KB
    matplotlib-base-3.4.3      |   py39h2fa2bec_0         7.3 MB
    ncurses-6.2                |       h58526e2_4         985 KB
    numpy-1.21.2               |   py39hdbf815f_0         6.2 MB
    olefile-0.46               |     pyh9f0ad1d_1          32 KB
    openjpeg-2.4.0             |       hb52868f_1         444 KB
    openssl-1.1.1k             |       h7f98852_1         2.1 MB
    pandas-1.3.2               |   py39hde0f152_0        13.0 MB
    pcre-8.45                  |       h9c3ff4c_0         253 KB
    pillow-8.3.1               |   py39ha612740_0         687 KB
    pip-21.2.4                 |     pyhd8ed1ab_0         1.1 MB
    pixman-0.40.0              |       h36c2ea0_0         627 KB
    pthread-stubs-0.4          |    h36c2ea0_1001           5 KB
    pycairo-1.20.1             |   py39hedcb9fc_0          77 KB
    pyparsing-2.4.7            |     pyh9f0ad1d_0          60 KB
    python-3.9.6               |h49503c6_1_cpython       27.5 MB
    python-dateutil-2.8.2      |     pyhd8ed1ab_0         240 KB
    python_abi-3.9             |           2_cp39           4 KB
    pytz-2021.1                |     pyhd8ed1ab_0         239 KB
    rdkit-2021.03.5            |   py39hccf6a74_0        38.3 MB
    readline-8.1               |       h46c0cb4_0         295 KB
    reportlab-3.5.68           |   py39he59360d_0         2.4 MB
    setuptools-57.4.0          |   py39hf3d152e_0         934 KB
    six-1.16.0                 |     pyh6c4a22f_0          14 KB
    sqlalchemy-1.4.23          |   py39h3811e60_0         2.3 MB
    sqlite-3.36.0              |       h9cd32fc_0         1.4 MB
    tk-8.6.11                  |       h21135ba_0         3.3 MB
    tornado-6.1                |   py39h3811e60_1         646 KB
    tzdata-2021a               |       he74cb21_1         121 KB
    wheel-0.37.0               |     pyhd8ed1ab_1          31 KB
    xorg-kbproto-1.0.7         |    h7f98852_1002          27 KB
    xorg-libice-1.0.10         |       h7f98852_0          58 KB
    xorg-libsm-1.2.3           |    hd9c2040_1000          26 KB
    xorg-libx11-1.7.2          |       h7f98852_0         941 KB
    xorg-libxau-1.0.9          |       h7f98852_0          13 KB
    xorg-libxdmcp-1.1.3        |       h7f98852_0          19 KB
    xorg-libxext-1.3.4         |       h7f98852_1          54 KB
    xorg-libxrender-0.9.10     |    h7f98852_1003          32 KB
    xorg-renderproto-0.11.1    |    h7f98852_1002           9 KB
    xorg-xextproto-7.3.0       |    h7f98852_1002          28 KB
    xorg-xproto-7.0.31         |    h7f98852_1007          73 KB
    xz-5.2.5                   |       h516909a_1         343 KB
    zlib-1.2.11                |    h516909a_1010         106 KB
    zstd-1.5.0                 |       ha95c52a_0         490 KB
    ------------------------------------------------------------
                                           Total:       162.2 MB
...

3. Activate the new Conda environment, my-rdkit-env.

herong$ conda activate my-rdkit-env

(my-rdkit-env) herong$

4. Verify RDKit installation.

(my-rdkit-env) herong$ python -c "import rdkit; print(rdkit.__version__);"

2021.03.5

Cool. I can use RDKit through its Python API now.

Note that installing RDKit with Anaconda will not give you the C++ API. If you need it, you can follow next tutorials to build it from source code or find a binary package for your computer system.

Table of Contents

 About This Book

 SMILES (Simplified Molecular-Input Line-Entry System)

 Open Babel: The Open Source Chemistry Toolbox

 Using Open Babel Command: "obabel"

 Generating SVG Pictures with Open Babel

 Substructure Search with Open Babel

 Similarity Search with Open Babel

 Fingerprint Index for Fastsearch with Open Babel

 Stereochemistry with Open Babel

 Command Line Tools Provided by Open Babel

RDKit: Open-Source Cheminformatics Software

 What Is RDKit

 RDKit Installation Options

Install RDKit in an Anaconda Environment

 Install RDKit Binary Package for CentOS

 Build RDKit from Source Code on CentOS System

 Compile, Link and Run RDKit C++ API Examples

 Try Python API with RDKit Native Code

 rdkit.Chem.rdchem - The Core Module

 rdkit.Chem.rdmolfiles - Molecular File Module

 rdkit.Chem.rdDepictor - Compute 2D Coordinates

 rdkit.Chem.Draw - Handle Molecule Images

 Molecule Substructure Search with RDKit

 rdkit.Chem.rdmolops - Molecule Operations

 Daylight Fingerprint Generator in RDKit

 Morgan Fingerprint Generator in RDKit

 RDKit Performance on Substructure Search

 Introduction to Molecular Fingerprints

 OCSR (Optical Chemical Structure Recognition)

 AlphaFold - Protein Structure Prediction

 Resources and Tools

 Cheminformatics Related Terminologies

 References

 Full Version in PDF/EPUB