Installation
You may choose one of two methods to install Treelite on your system:
Download binary releases from PyPI (Recommended)
This is probably the most convenient method. Simply type
pip install treelite
to install the Treelite package. The command will locate the binary release that is compatible with your current platform. Check the installation by running
import treelite
in an interactive Python session. This method is available for only Windows, MacOS, and Linux. For other operating systems, see the next section.
Note
Windows users need to install Visual C++ Redistributable
Treelite requires DLLs from Visual C++ Redistributable in order to function, so make sure to install it. Exception: If you have Visual Studio installed, you already have access to necessary libraries and thus don’t need to install Visual C++ Redistributable.
Note
Installing OpenMP runtime on MacOS
Treelite requires the presence of OpenMP runtime. To install OpenMP runtime on a MacOS system, run the following command:
brew install libomp
Download binary releases from Conda
Treelite is also available on Conda.
conda install -c conda-forge treelite
to install the Treelite package. See https://anaconda.org/conda-forge/treelite to check the available platforms.
Compile Treelite from the source
Installation consists of two steps:
Build the shared libraries from C++ code (See the note below for the list.)
Install the Python package.
Note
List of libraries created
Operating System |
Main library |
---|---|
Windows |
|
MacOS |
|
Linux / other UNIX |
|
To get started, clone Treelite repo from GitHub.
git clone https://github.com/dmlc/treelite.git
cd treelite
The next step is to build the shared libraries.
2. Installing Python package
The Python package is located at the python
subdirectory. Run Pip to install the Python
package. The Python package will re-use the native library built in Step 1.
cd python
pip install . # will re-use libtreelite.so