Installation

Requirements

PyKale requires Python 3.8, 3.9, or 3.10. Before installing pykale, you should

  • manually install PyTorch matching your hardware first,

  • if you will use APIs related to graphs, you need to manually install PyTorch Geometric first following its official instructions and matching your PyTorch installation, and

  • If RDKit will be used, you need to install it via pip install rdkit.

Pip install

Install PyKale using pip for the stable version:

pip install pykale  # for the core API only

Install from source

Install from source for the latest version and/or development:

git clone https://github.com/pykale/pykale
cd pykale
pip install .  # for the core API only
pip install -e .[dev]  # editable install for developers including all dependencies and examples

Installation options

PyKale provides six installation options for different user needs:

  • default: pip install pykale for essential functionality

  • graph: pip install pykale[graph] for graph-related functionality (e.g., TDC)

  • image: pip install pykale[image] for image-related functionality (e.g., DICOM)

  • example: pip install pykale[example] for examples and tutorials

  • full: pip install pykale[full] for all functionality, including examples and tutorials

  • dev: pip install pykale[dev] for development, including all functionality, examples, and tutorials

Multiple options can be chosen by separating them with commas (without whitespace). See examples below.

pip install pykale[graph,example]
pip install pykale[graph,image]
pip install pykale[graph,image,example]

Tests

For local unit tests on all kale API, you need to have PyTorch, PyTorch Geometric, and RDKit installed (see the top) and then run pytest at the root directory:

pytest

You can also run pytest on individual module (see pytest documentation).