Unverified Commit 01e37ea5 authored by Bharath Ramsundar's avatar Bharath Ramsundar Committed by GitHub
Browse files

Merge pull request #1986 from nd-02110114/fix-deepchem-build

Fix pip publish
parents 9223166b c50693b9
Loading
Loading
Loading
Loading
+25 −116
Original line number Diff line number Diff line
@@ -15,11 +15,10 @@ materials science, quantum chemistry, and biology.

- [Requirements](#requirements)
- [Installation](#installation)
  - [Install latest package with conda](#install-via-conda-recommendation)
  - [Install latest package with pip (WIP)](#install-via-pip-wip)
  - [Install from source](#install-from-source)
  - [Install using a Docker](#install-using-a-docker)
- [FAQ and Troubleshooting](#faq-and-troubleshooting)
  - [Stable version](#stable-version)
  - [Nightly version](#nightly-build-version)
  - [Docker](#docker)
  - [From source](#from-source)
- [Getting Started](#getting-started)
- [Contributing to DeepChem](/CONTRIBUTING.md)
  - [Code Style Guidelines](/CONTRIBUTING.md#code-style-guidelines)
@@ -30,7 +29,7 @@ materials science, quantum chemistry, and biology.

## Requirements

DeepChem requires these packages on any condition.
DeepChem currently supports Python 3.5 through 3.7 and requires these packages on any condition.

- [joblib](https://pypi.python.org/pypi/joblib)
- [NumPy](https://numpy.org/)
@@ -64,88 +63,43 @@ DeepChem has a number of "soft" requirements. These are packages which are neede

## Installation

### Install via conda (Recommendation)
### Stable version

RDKit is a soft requirement package, but many useful methods like molnet depend on it.
If you use conda, we recommend installing RDKit with deepchem.
**Caution!!:**  
**The latest stable version was published nearly a year ago. If you are a pip user or you face some errors, we recommend the nightly build version.**

`deepchem>=2.4.0`

Coming soon...

`deepchem<2.4.0`
RDKit is a soft requirement package, but many useful methods like molnet depend on it. We recommend installing RDKit with deepchem.

```bash
pip install tensorflow==1.14
conda install -c rdkit -c conda-forge rdkit deepchem==2.3.0
conda install -y -c rdkit -c conda-forge rdkit deepchem==2.3.0
```

If you want GPU support:

```bash
pip install tensorflow-gpu==1.14
conda install -c rdkit -c conda-forge rdkit deepchem==2.3.0
```

### Install via pip (WIP)

You are able to try to install deepchem via pip using the following command.  
However, pip installation is under development, so this command may not work well.

`deepchem>=2.4.0`

Coming soon...

`deepchem<2.4.0`

```bash
pip install pandas pillow scikit-learn==0.22 tensorflow==1.14 deepchem==2.2.1.dev54
```

If you want GPU support:

```bash
pip install pandas pillow scikit-learn==0.22 tensorflow-gpu==1.14 deepchem==2.2.1.dev54
conda install -y -c rdkit -c conda-forge rdkit deepchem==2.3.0
```

### Install from source

You can install deepchem in a new conda environment using the conda commands in `scripts/install_deepchem_conda.sh.` Installing via this script will ensure that you are **installing from the source**.
The following script requires `conda>=4.4` because it uses the `conda activate` command. (Please see the detail from [here](https://github.com/conda/conda/blob/a4c4feae404b2b378e106bd25f62cc8be15c768f/CHANGELOG.md#440-2017-12-20))

First, please clone the deepchem repository from GitHub.

```bash
git clone https://github.com/deepchem/deepchem.git
cd deepchem
```
### Nightly build version

Then, execute the shell script.
You install the nightly build version via pip. Nightly version is built by the HEAD of DeepChem.

```bash
bash scripts/install_deepchem_conda.sh deepchem
```

If you are using the Windows and the PowerShell:

```ps1
.\scripts\install_deepchem_conda.ps1 deepchem
pip install tensorflow==2.2
pip install --pre deepchem
```

Before activating deepchem environment, make sure conda has been initialized.  
Check if there is a `(base)` in your command line. If not, use `conda init <YOUR_SHELL_NAME>` to activate it, then:
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.

```bash
conda activate deepchem
python setup.py install
pytest -m "not slow" deepchem # optional
conda install -y -c rdkit rdkit
```

Check [this link](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) for more information about the installation of conda environments.

### Install using a Docker
### Docker

If you want to install using a docker, you can pull two kinds of images.  
If you want to install deepchem using a docker, you can pull two kinds of images.  
DockerHub : https://hub.docker.com/repository/docker/deepchemio/deepchem

- `deepchemio/deepchem:x.x.x`
@@ -157,64 +111,19 @@ DockerHub : https://hub.docker.com/repository/docker/deepchemio/deepchem
  - The latest image is built every time we commit to the master branch
  - Dockerfile is put in `docker/master` directory

First, you pull the image you want to use.
You pull the image like this.

```bash
docker pull deepchemio/deepchem:2.3.0
```

Then, you create a container based on the image.
If you want to know docker usages with deepchem in more detail, please check [the document](https://deepchem.readthedocs.io/en/latest/installation.html#docker).

```bash
docker run --rm -it deepchemio/deepchem:2.3.0
```

If you want GPU support:

```bash
# If nvidia-docker is installed
nvidia-docker run --rm -it deepchemio/deepchem:2.3.0
docker run --runtime nvidia --rm -it deepchemio/deepchem:2.3.0

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

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
```
### From source

If you want to check the tox21 benchmark:
If you try install all soft dependencies at once or contribute to deepchem, we recommend you should install deepchem from source.

```bash
(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
```

## FAQ and Troubleshooting

1. DeepChem currently supports Python 3.5 through 3.7, and is supported on 64 bit Linux and Mac OSX. Note that DeepChem is not currently maintained for older versions of Python or with other operating systems.
2. Question: I'm seeing some failures in my test suite having to do with MKL
   `Intel MKL FATAL ERROR: Cannot load libmkl_avx.so or libmkl_def.so.`

   Answer: This is a general issue with the newest version of `scikit-learn` enabling MKL by default. This doesn't play well with many linux systems. See [BVLC/caffe#3884](https://github.com/BVLC/caffe/issues/3884) for discussions. The following seems to fix the issue

   ```bash
   conda install nomkl numpy scipy scikit-learn numexpr
   conda remove mkl mkl-service
   ```

3. Note that when using Ubuntu 16.04 server or similar environments, you may need to ensure libxrender is provided via e.g.:

```bash
sudo apt-get install -y libxrender-dev
```
Please check [this introduction](https://deepchem.readthedocs.io/en/latest/installation.html#from-source).

## Getting Started

@@ -248,4 +157,4 @@ To cite this book, please use this bibtex entry:

## Version

2.3.0
2.4.0-rc
+68 −17
Original line number Diff line number Diff line
@@ -8,8 +8,14 @@ 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.

Conda Installation
------------------

Stable version
--------------

**Caution!! : The latest stable version was published nearly a year ago.
If you are a pip user or you face some errors, we recommend 
the nightly build version.**

If you'd like to install DeepChem locally, we recommend using
:code:`conda` and installing RDKit with deepchem. 
RDKit is a soft requirement package, but many useful methods like
@@ -27,24 +33,33 @@ For CPU only support instead run
    pip install tensorflow==1.14
    conda install -y -c rdkit -c conda-forge rdkit deepchem

Then open your python and try running.

.. code-block:: python
Nightly build version
---------------------

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

.. code-block:: bash

    pip install tensorflow==2.2
    pip install --pre deepchem


    import 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.

.. code-block:: bash

Pip Installation
----------------
We are working on improving our pip installation
capabilities. We'll update our docs once we have more information on
how to do this well.
    conda install -y -c rdkit rdkit


Docker Installation
-------------------
Docker
------

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

- **deepchemio/deepchem:x.x.x**

@@ -102,14 +117,50 @@ If you want to check the tox21 benchmark:
    (deepchem) root@xxxxxxxxxxxxx:~/mydir# python benchmark.py -d tox21 -m graphconv -s random


Installing from Source
----------------------
From Source
-----------

You can install deepchem in a new conda environment using the conda
commands in :code:`scripts/install_deepchem_conda.sh`. Installing via this
script will ensure that you are **installing from the source**.
The following script requires **conda>=4.4** because it uses the
:code:`conda activate` command.

First, please clone the deepchem repository from GitHub.

.. code-block:: bash

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


Then, execute the shell script.

.. code-block:: bash

    bash scripts/install_deepchem_conda.sh deepchem


If you are using the Windows and the PowerShell:

.. code-block:: ps1

    .\scripts\install_deepchem_conda.ps1 deepchem


| Before activating deepchem environment, make sure conda has been initialized.
| Check if there is a :code:`(base)` in your command line. 
| If not, use :code:`conda init <YOUR_SHELL_NAME>` to activate it, then:

.. code-block:: bash

    conda activate deepchem
    python setup.py install
    pytest -m "not slow" deepchem # optional

Check out our directions on Github for how to `install from source`_.

.. _`DeepChem Tutorials`: https://github.com/deepchem/deepchem/tree/master/examples/tutorials
.. _`forum post`: https://forum.deepchem.io/t/getting-deepchem-running-in-colab/81
.. _`DockerHub`: https://hub.docker.com/repository/docker/deepchemio/deepchem
.. _`docker/conda-forge`: https://github.com/deepchem/deepchem/tree/master/docker/conda-forge
.. _`docker/master`: https://github.com/deepchem/deepchem/tree/master/docker/master
.. _`install from source`: https://github.com/deepchem/deepchem/blob/master/README.md#install-from-source
+5 −3
Original line number Diff line number Diff line
@@ -32,14 +32,16 @@ If you're new, you can install DeepChem on a new machine with the following comm

.. code-block:: bash

  pip install tensorflow
  pip install deepchem-nightly
    pip install tensorflow==2.2
    pip install --pre deepchem


DeepChem is under very active development at present, so we recommend using our nightly build until we release a next major release. Note that to use DeepChem for chemistry applications, you will have to also install RDKit using conda.

.. code-block:: bash

  conda install -y -c rdkit -c conda-forge rdkit
    conda install -y -c rdkit rdkit



Datasets
+7 −15
Original line number Diff line number Diff line
@@ -3,16 +3,11 @@ import time
from setuptools import setup, find_packages

if '--release' in sys.argv:
  release = True
  IS_RELEASE = True
  sys.argv.remove('--release')
else:
  # Build a nightly package by default.
  release = False

if release:
  project_name = 'deepchem'
else:
  project_name = 'deepchem-nightly'
  IS_RELEASE = False


# get the version from deepchem/__init__.py
@@ -22,19 +17,16 @@ def _get_version():
      if line.startswith('__version__'):
        g = {}
        exec(line, g)
        if project_name == "deepchem":
          return g['__version__']
        else:
          # nightly version string .devYearMonthDayHourMinute
        base = g['__version__']
          dev_version = ".dev" + time.strftime("%Y%m%d%H%M%S")
          return base + dev_version
        # nightly version string .devYearMonthDayHourMinute
        return base if IS_RELEASE else \
          base + ".dev" + time.strftime("%Y%m%d%H%M%S")

    raise ValueError('`__version__` not defined in `deepchem/__init__.py`')


setup(
    name=project_name,
    name='deepchem',
    version=_get_version(),
    url='https://github.com/deepchem/deepchem',
    maintainer='DeepChem contributors',