Some of the models depend on prophet
and torch
, which have non-Python dependencies.
A Conda environment is thus recommended because it will handle all of those in one go.
Currently only the x86_64 architecture with Python 3.7-3.9 is fully supported with conda; consider using PyPI if you are running into troubles.
To create a conda environment for Python 3.7 (after installing conda):
conda create --name <env-name> python=3.7
Don't forget to activate your virtual environment
conda activate <env-name>
As some models have relatively heavy dependencies, we provide two conda-forge packages:
- Install darts with all available models (recommended):
conda install -c conda-forge -c pytorch u8darts-all
. - Install core + neural networks (PyTorch):
conda install -c conda-forge -c pytorch u8darts-torch
- Install core only (without neural networks, Prophet or AutoARIMA):
conda install -c conda-forge u8darts
For GPU support, please follow the instructions to install CUDA in the PyTorch installation guide.
Install darts with all available models: pip install darts
.
If this fails on your platform, please follow the official installation guides for prophet and torch, then try installing Darts again.
As some models have relatively heavy (or non-Python) dependencies,
we also maintain the u8darts
package, which provides the following alternate lighter install options:
- Install core only (without neural networks, Prophet or AutoARIMA):
pip install u8darts
- Install core + neural networks (PyTorch):
pip install "u8darts[torch]"
- Install core + Facebook Prophet:
pip install "u8darts[prophet]"
- Install core + AutoARIMA:
pip install "u8darts[pmdarima]"
To enable support for LightGBM in Darts, please follow the installation instructions for your OS.
At the time of writing, there is an issue with libomp
12.0.1 that results in
segmentation fault on Mac OS Big Sur.
Here's the procedure to downgrade the libomp
library (from the
original Github issue):
- Install brew if you don't already have it.
- Install
wget
if you don't already have it :brew install wget
. - Run the commands below:
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
brew unlink libomp
brew install libomp.rb
If the conda setup is causing too many problems, we also provide a Docker image with everything set up for you and ready-to-use Python notebooks with demo examples. To run the example notebooks without installing our libraries natively on your machine, you can use our Docker image:
./gradlew docker && ./gradlew dockerRun
Then copy and paste the URL provided by the docker container into your browser to access Jupyter notebook.
For this setup to work you need to have a Docker service installed. You can get it at Docker website.
The gradle setup works best when used in a python environment, but the only requirement is to have pip
installed for Python 3+
To run all tests at once just run
./gradlew test_all
alternatively you can run
./gradlew unitTest_all # to run only unittests
./gradlew coverageTest # to run coverage
./gradlew lint # to run linter
To run the tests for specific flavours of the library, replace _all
with _core
, _prophet
, _pmdarima
or _torch
.
To build documentation locally just run
./gradlew buildDocs
After that docs will be available in ./docs/build/html
directory. You can just open ./docs/build/html/index.html
using your favourite browser.