|
2 | 2 |
|
3 | 3 | Below, we detail how to install Darts using either `conda` or `pip`.
|
4 | 4 |
|
| 5 | +## From PyPI |
| 6 | +Install darts with all models expect the ones from optional dependencies (Prophet, LightGBM, CatBoost, see more on that [here](#enabling-optional-dependencies)): `pip install darts`. |
| 7 | + |
| 8 | +If this fails on your platform, please follow the official installation |
| 9 | +guide for [PyTorch](https://pytorch.org/get-started/locally/), then try installing Darts again. |
| 10 | + |
| 11 | +As some dependencies are relatively big or involve non-Python dependencies, |
| 12 | +we also maintain the `u8darts` package, which provides the following alternate lighter install options: |
| 13 | + |
| 14 | +* Install darts with all available models: `pip install u8darts[all]` |
| 15 | +* Install core only (without neural networks, Prophet, LightGBM and Catboost): `pip install u8darts` |
| 16 | +* Install core + Prophet + LightGBM + CatBoost: `pip install "u8darts[notorch]"` |
| 17 | +* Install core + neural networks (PyTorch): `pip install "u8darts[torch]"` (equivalent to `pip install darts`) |
| 18 | + |
5 | 19 | ## From conda-forge
|
6 | 20 | Currently only the x86_64 architecture with Python 3.8-3.10
|
7 | 21 | is fully supported with conda; consider using PyPI if you are running into troubles.
|
8 | 22 |
|
9 |
| -To create a conda environment for Python 3.9 |
| 23 | +Create a conda environment (e.g., for Python 3.10): |
10 | 24 | (after installing [conda](https://docs.conda.io/en/latest/miniconda.html)):
|
11 | 25 |
|
12 |
| - conda create --name <env-name> python=3.9 |
| 26 | + conda create --name <env-name> python=3.10 |
13 | 27 |
|
14 |
| -Don't forget to activate your virtual environment |
| 28 | +Activate the environment |
15 | 29 |
|
16 | 30 | conda activate <env-name>
|
17 | 31 |
|
18 |
| -As some models have relatively heavy dependencies, we provide two conda-forge packages: |
| 32 | +As some models have relatively heavy dependencies, we provide four conda-forge packages: |
19 | 33 |
|
20 |
| -* Install darts with all available models (recommended): `conda install -c conda-forge -c pytorch u8darts-all`. |
| 34 | +* Install darts with all available models: `conda install -c conda-forge -c pytorch u8darts-all` |
| 35 | +* Install core only (without neural networks, Prophet, LightGBM and Catboost): `conda install -c conda-forge u8darts` |
| 36 | +* Install core + Prophet + LightGBM + CatBoost: `pip install "u8darts-notorch"` |
21 | 37 | * Install core + neural networks (PyTorch): `conda install -c conda-forge -c pytorch u8darts-torch`
|
22 |
| -* Install core only (without neural networks or AutoARIMA): `conda install -c conda-forge u8darts` |
23 | 38 |
|
24 |
| -For GPU support, please follow the instructions to install CUDA in the [PyTorch installation guide](https://pytorch.org/get-started/locally/). |
25 | 39 |
|
| 40 | +## Other Information |
26 | 41 |
|
27 |
| -## From PyPI |
28 |
| -Install darts with all available models: `pip install darts`. |
| 42 | +### Enabling Optional Dependencies |
| 43 | +By default, as of 0.25.0, `darts` does not have Prophet, CatBoost, and LightGBM as dependencies anymore, because their |
| 44 | +build processes were too often causing issues. If you want to use any of Darts' `Prophet`, `CatBoostModel`, and |
| 45 | +`LightGBMModel`, you will need to manually install the corresponding packages. |
29 | 46 |
|
30 |
| -If this fails on your platform, please follow the official installation |
31 |
| -guide for [PyTorch](https://pytorch.org/get-started/locally/), then try installing Darts again. |
| 47 | +#### Prophet |
| 48 | +Install the `prophet` package (version 1.1.1 or more recent) using the [Prophet install guide](https://facebook.github.io/prophet/docs/installation.html#python) |
32 | 49 |
|
33 |
| -As some dependencies are relatively big or involve non-Python dependencies, |
34 |
| -we also maintain the `u8darts` package, which provides the following alternate lighter install options: |
| 50 | +#### CatBoostModel |
| 51 | +Install the `catboost` package (version 1.0.6 or more recent) using the [CatBoost install guide](https://catboost.ai/en/docs/concepts/python-installation) |
35 | 52 |
|
36 |
| -* Install core only (without neural networks, Prophet or AutoARIMA): `pip install u8darts` |
37 |
| -* Install core + neural networks (PyTorch): `pip install "u8darts[torch]"` |
38 |
| -* Install core + AutoARIMA: `pip install "u8darts[pmdarima]"` |
| 53 | +#### LightGBMModel |
| 54 | +Install the `lightgbm` package (version 3.2.0 or more recent) using the [LightGBM install guide](https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html) |
39 | 55 |
|
40 |
| -### Enabling Support for LightGBM |
41 |
| - |
42 |
| -To enable support for LightGBM in Darts, please follow the |
43 |
| -[installation instructions](https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html) for your OS. |
44 |
| - |
45 |
| -#### MacOS Issues with LightGBM |
46 |
| -At the time of writing, there is an issue with ``libomp`` 12.0.1 that results in |
47 |
| -[segmentation fault on Mac OS Big Sur](https://github.com/microsoft/LightGBM/issues/4229). |
48 |
| -Here's the procedure to downgrade the ``libomp`` library (from the |
49 |
| -[original Github issue](https://github.com/microsoft/LightGBM/issues/4229#issue-867528353)): |
50 |
| -* [Install brew](https://brew.sh/) if you don't already have it. |
51 |
| -* Install `wget` if you don't already have it : `brew install wget`. |
52 |
| -* Run the commands below: |
53 |
| -``` |
54 |
| -wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb |
55 |
| -brew unlink libomp |
56 |
| -brew install libomp.rb |
57 |
| -``` |
| 56 | +### Enabling GPU support |
| 57 | +Darts relies on PyTorch for the neural network models. |
| 58 | +For GPU support, please follow the instructions to install CUDA in the [PyTorch installation guide](https://pytorch.org/get-started/locally/). |
58 | 59 |
|
59 |
| -#### Test environment Apple M1 processor |
| 60 | +### Using an emulated x64 environment on Apple Silicon. |
| 61 | +The installation of `darts` has been tested to work on Apple silicon (M1) (Python 3.10, OSX Ventura 13.2.1). |
60 | 62 |
|
61 |
| -We currently recommend to run Darts in an x_64 emulated environment on Mac computers with the Silicon M1 processor, |
62 |
| -instead of trying to install directly with native arm64 packages, many of the dependent packages still have compatibility |
63 |
| -issues. The following is a proposed procedure, if you tested other procedures on similar hardware and they worked, |
64 |
| -please let us know about them by opening an issue or by updating this file and opening a PR. |
| 63 | +If you run into issues, you can always use rosetta to run in an (intel) emulated x64 environment: |
65 | 64 |
|
66 | 65 | Before you start make sure that you have rosetta2 installed by running:
|
67 |
| -``` |
| 66 | + |
| 67 | +```bash |
68 | 68 | pgrep oahd
|
69 | 69 | ```
|
70 |
| -If you see some process id you are ready to go, as internally rosetta is known as oah. |
| 70 | + |
| 71 | +If you see a process id you are ready to go, as internally rosetta is known as oah. |
71 | 72 |
|
72 | 73 | If pgrep doesn't return any id then install rosetta2:
|
73 |
| -``` |
| 74 | + |
| 75 | +```bash |
74 | 76 | softwareupdate --install-rosetta
|
75 | 77 | ```
|
76 | 78 |
|
77 | 79 | Below are the necessary instructions to create and configure the environment:
|
78 |
| -- Start by installing conda (e.g., with miniforge : `brew install miniforge`). |
79 |
| -- Create the x_64 environment : `CONDA_SUBDIR=osx-64 conda create -n env_name python=3.9 pip` |
80 |
| -- Activate the created environment: `conda activate env_name` |
| 80 | +- Install conda if you haven't done so (e.g., with miniforge : `brew install miniforge`). |
| 81 | +- Create the x_64 environment : `CONDA_SUBDIR=osx-64 conda create -n env_name python=3.10 pip` |
| 82 | +- Activate the environment: `conda activate env_name` |
81 | 83 | - Configure the environment : `conda env config vars set CONDA_SUBDIR=osx-64`
|
82 | 84 | - Deactivate and reactivate the environment:
|
83 |
| - ``` |
| 85 | + ```bash |
84 | 86 | conda deactivate
|
85 | 87 | conda activate env_name
|
86 | 88 | ```
|
87 | 89 | - Install darts: `pip install darts`
|
88 |
| - - With this method of installation, lightgbm might still have issues finding the libomp library. |
89 |
| - The following procedure is to guarantee that the correct libomp (11.1.0) library is linked. |
90 |
| - - Unlink the existing libomp, from terminal : `brew unlink libomp` |
91 |
| - - Setup a homebrew installer that is compatible with x_64 packages (follow this [blog](https://medium.com/mkdir-awesome/how-to-install-x86-64-homebrew-packages-on-apple-m1-macbook-54ba295230f) |
92 |
| - post): |
93 |
| - ``` |
94 |
| - cd ~/Downloads |
95 |
| - mkdir homebrew |
96 |
| - curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew |
97 |
| - sudo mv homebrew /usr/local/homebrew |
98 |
| - export PATH=$HOME/bin:/usr/local/bin:$PATH |
99 |
| - ``` |
100 |
| - - At this point, we have a new brew command located at /usr/local/homebrew/bin/brew |
101 |
| - - In the following code bits we download version 11.1.0 of libomp, install it as a x_64 compatible package and link to it so that lightgbm can find it: |
102 |
| - ``` |
103 |
| - wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb |
104 |
| - arch -x86_64 /usr/local/homebrew/bin/brew install libomp.rb |
105 |
| - sudo ln -s /usr/local/homebrew/Cellar/libomp/11.1.0/lib /usr/local/opt/libomp/lib |
106 |
| - ``` |
107 |
| - - Verify that your lightgbm works by importing lightgbm from your python env. It should not give library loading errors. |
108 |
| -
|
109 |
| -## Running the examples only, without installing: |
| 90 | + |
| 91 | +### Running the examples only, without installing: |
110 | 92 |
|
111 | 93 | 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.
|
112 | 94 | To run the example notebooks without installing our libraries natively on your machine, you can use our Docker image:
|
|
0 commit comments