Skip to Content

Install the SAP HANA Python Client API for Machine Learning Algorithms

Install the SAP HANA Python Client API for machine learning algorithms.
You will learn

You will learn how to install the SAP HANA Python Client API for Machine Learning Algorithms.

aplata-sapAdrian PlataNovember 12, 2020
Created by
October 1, 2018


Ensure that you have Python 2.7 or 3.6 installed.

You have downloaded, extracted, and installed one of the SAP HANA HDB clients. See Install the SAP HANA, express edition clients.

You have also installed the Python driver that comes with the clients. See Use Clients to Query an SAP HANA Database.

SAP HANA provides a python client API for working with machine learning algorithms. The Python Client API for ML files come packages with the Windows and Linux SAP HANA HDB client downloads.

This API is released as an experimental preview and subject to changes now and in the future.

To install the Python Client API for ML on a client machine, do the following:

  • Step 1

    For the location you extracted the SAP HANA HDB client files, run:

    pip install hana_ml-<version>.tar.gz

    This command installs the hana_ml package containing the following modules and sub-modules:

    • hana_ml.dataframe

    • hana_ml.algorithms package

      • hana_ml.algorithms.classification

      • hana_ml.algorithms.clustering

      • hana_ml.algorithms.decomposition

      • hana_ml.algorithms.metrics

      • hana_ml.algorithms.mixture

      • hana_ml.algorithms.neighbors

      • hana_ml.algorithms.neural_network

      • hana_ml.algorithms.preprocessing

      • hana_ml.algorithms.regression

      • hana_ml.algorithms.stats

      • hana_ml.algorithms.svm

      • hana_ml.algorithms.trees

    • hana_ml.ml_exceptions

  • Step 2

    To test that Python Client API for ML was installed successfully, run:

    cd /usr/lib/python<version>/site-packages/

    You will see a list of installed Python packages. You will find hana_ml among them if it was installed successfully. Alternatively, you can run:

    pip list

    You will receive a list of various Python packages that are installed on your system. If you see hana-ml and the appropriate version, the Python Client API for ML was installed.

Back to top