Qlib Installation


Qlib supports both Windows and Linux. It’s recommended to use Qlib in Linux. Qlib supports Python3, which is up to Python3.8.

Please follow the steps below to install Qlib:

  • Enter the root directory of Qlib, in which the file exists.

  • Then, please execute the following command to install the environment dependencies and install Qlib:

    $ pip install numpy
    $ pip install --upgrade cython
    $ git clone && cd qlib
    $ python install


It’s recommended to use anaconda/miniconda to setup the environment. Qlib needs lightgbm and pytorch packages, use pip to install them.


Do not import qlib in the root directory of Qlib, otherwise, errors may occur.

Use the following code to make sure the installation successful:

>>> import qlib
>>> qlib.__version__