Install the Python Driver
Install the Python driver into your local Python environment by using the pip installer so that you can use the Python driver to connect to an SAP HANA database.
Prerequisites
You have run the SAP HANA client install.
Procedure
- If you have multiple Python environments, then activate the Python environment where you want to install the Python driver. If you don’t have multiple Python environments, then ignore this step.
- Run the install:
Platform Command UNIX, Linux, and macOS Use one of the following install methods:
-
pip install
pip install /usr/sap/hdbclient/hdbcli-N.N.N.tar.gz
-
easy_install
easy_install /usr/sap/hdbclient/hdbcli-N.N.N.tar.gz
-
disutils installer
tar -xf hdbcli-N.N.N.tar.gz
Then run:
cd hdbcli-N.N.N
Lastly, run:
setup.py install
- To install the Python driver only for the current user, then add --user after "install" to any of the above commands.
Microsoft Windows Use one of the following install methods:
-
pip install
pip install "C:\Program Files\SAP\hdbclient\hdbcli-N.N.N.zip"
-
easy_install
easy_install "C:\Program Files\SAP\hdbclient\hdbcli-N.N.N.zip"
-
disutils installer
Unzip hdbcli-N.N.N.zip into a directory, then run:
cd hdbcli-N.N.N
Lastly, run:
setup.py install
- To install the Python driver only for the current user, then add --user after "install" to any of the above commands.
Python Package Index Use the following install methods:
-
PyPI
pip install hdbcli
-
pip install (preferred)
python -m pip install hdbcli==N.N.N
-
easy_install (deprecated)
-m easy_install hdbcli==N.N.N
- To install the Python driver only for the current user, then add --user after "install" to any of the above commands.
-
