InstallationΒΆ

InstallationΒΆ

Mac OS X and Ubuntu LinuxΒΆ

  1. Make sure you install the latest version of the Anaconda 3 distribution. To do this you can follow the install and update instructions found on this link

  2. Launch a terminal

  3. Create a New Conda Environment. From terminal.

    conda create -n <env name> python=3.8 anaconda
    

    Accept all the requests to install.

  4. Now activate the environment with:

    source activate <env name>
    
  5. From Terminal: install the MlFinLab package:

    pip install mlfinlab
    
  6. (Optional) Only if you want to use the CorrGAN from the Data Generation Module, install the TensorFlow package. Note that you should have pip version β€œpip==20.1.1” to do this. Supported TensorFlow version is β€œtensorflow==2.2.1”.

    To change the pip version:

    pip install --user "pip==20.1.1"
    

    To install TensorFlow:

    pip install "tensorflow==2.2.1"
    

    Warning

    You may be encountering the following error during the installation:

    ERROR: tensorflow 2.2.1 has requirement numpy<1.19.0,>=1.16.0, but you'll have numpy 1.20.1 which is incompatible.

    You can ignore this message. It appears due to the updated dependency versions in the MlFinLab package.

    All the MlFinLab functionality still works as expected.

WindowsΒΆ

Warning

Before installing MlFinLab on Windows machines you should download and install Visual Studio build tools for Python3. You can use this installation guide.

Option A (with user interface)

  1. Download and install the latest version of Anaconda 3

  2. Launch Anaconda Navigator

  3. Click Environments, choose an environment name, select Python 3.8, and click Create

  4. Click Home, browse to your new environment, and click Install under Jupyter Notebook

  5. Launch Anaconda Prompt and activate the environment:

    conda activate <env name>
    
  6. From Anaconda Prompt: install the MlFinLab package:

    pip install mlfinlab
    

Option B (with command prompt)

  1. Download and install the latest version of Anaconda 3

  2. Launch Anacoda Prompt

  3. Create new environment (replace <env name> with a name, for example mlfinlab):

    conda create -n <env name> python=3.8
    
  4. Activate the new environment:

    conda activate <env name>
    
  5. Install scs library (try one of the below options):

    pip install scs
    
    conda install -c conda-forge scs
    
    conda install -c anaconda ecos
    
  6. Install MlFinLab:

    pip install mlfinlab
    

    Note

    If you have problems with installation related to Numba and llvmlight, this solution might help.

  7. (Optional) Only if you want to use the CorrGAN from the Data Generation Module, install the TensorFlow package. Note that you should have pip version β€œpip==20.1.1” to do this. Supported TensorFlow version is β€œtensorflow==2.2.1”.

    To change the pip version:

    pip install --user "pip==20.1.1"
    

    To install TensorFlow:

    pip install "tensorflow==2.2.1"
    

    Warning

    You may be encountering the following error during the installation:

    ERROR: tensorflow 2.2.1 has requirement numpy<1.19.0,>=1.16.0, but you'll have numpy 1.20.1 which is incompatible.

    You can ignore this message. It appears due to the updated dependency versions in the MlFinLab package.

    All the MlFinLab functionality still works as expected.