Installation

Stable version

Please install tensorflow v2.3.* before installing deepchem.

pip install tensorflow==2.3.*

Then, you install deepchem via pip or conda.

pip install deepchem

or

conda install -c conda-forge deepchem

RDKit is a soft requirement package, but many useful methods like molnet depend on it. We recommend installing RDKit with deepchem if you use conda.

conda install -y -c conda-forge rdkit

Nightly build version

You install the nightly build version via pip. The nightly version is built by the HEAD of DeepChem.

pip install tensorflow==2.3.*
pip install --pre deepchem

Google Colab

The fastest way to get up and running with DeepChem is to run it on Google Colab. Check out one of the DeepChem Tutorials or this forum post for Colab quick start guides.

Docker

If you want to install using a docker, you can pull two kinds of images from DockerHub.

  • deepchemio/deepchem:x.x.x

    • Image built by using a conda (x.x.x is a version of deepchem)

    • This image is built when we push x.x.x. tag

    • Dockerfile is put in `docker/tag`_ directory

  • deepchemio/deepchem:latest

    • Image built from source codes

    • This image is built every time we commit to the master branch

    • Dockerfile is put in `docker/nightly`_ directory

First, you pull the image you want to use.

docker pull deepchemio/deepchem:latest

Then, you create a container based on the image.

docker run --rm -it deepchemio/deepchem:latest

If you want GPU support:

# If nvidia-docker is installed
nvidia-docker run --rm -it deepchemio/deepchem:latest
docker run --runtime nvidia --rm -it deepchemio/deepchem:latest

# If nvidia-container-toolkit is installed
docker run --gpus all --rm -it deepchemio/deepchem:latest

You are now in a docker container which deepchem was installed. You can start playing with it in the command line.

(deepchem) root@xxxxxxxxxxxxx:~/mydir# python
Python 3.6.10 |Anaconda, Inc.| (default, May  8 2020, 02:54:21)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import deepchem as dc

If you want to check the tox21 benchmark:

# you can run our tox21 benchmark
(deepchem) root@xxxxxxxxxxxxx:~/mydir# wget https://raw.githubusercontent.com/deepchem/deepchem/master/examples/benchmark.py
(deepchem) root@xxxxxxxxxxxxx:~/mydir# python benchmark.py -d tox21 -m graphconv -s random

From source with conda

Installing via these steps will ensure you are installing from the source.

Prerequisite

  • Shell: Bash, Zsh, PowerShell

  • Conda: >4.6

First, please clone the deepchem repository from GitHub.

git clone https://github.com/deepchem/deepchem.git
cd deepchem

Then, execute the shell script. The shell scripts require two arguments, python version and gpu/cpu.

source scripts/install_deepchem_conda.sh 3.7 cpu

If you want GPU support (we supports only CUDA 10.1):

source scripts/install_deepchem_conda.sh 3.7 gpu

If you are using the Windows and the PowerShell:

. .\scripts\install_deepchem_conda.ps1 3.7 cpu
Before activating deepchem environment, make sure conda has been initialized.
Check if there is a (XXXX) in your command line.
If not, use conda init <YOUR_SHELL_NAME> to activate it, then:
conda activate deepchem
pip install -e .
pytest -m "not slow" deepchem # optional