From 01deb5cc6e9081f3629a919cdac2fdd9324e7bce Mon Sep 17 00:00:00 2001 From: Gaurav Sharma Date: Fri, 29 Aug 2025 13:09:02 +0530 Subject: [PATCH 1/3] FIX: README - Kerberos Dependencies on Linux --- README.md | 13 ++++++++----- mssql_python/pybind/ddbc_bindings.cpp | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ef69b313..5b80d651 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,16 @@ pip install mssql-python **Linux:** mssql-python can be installed with [pip](http://pypi.python.org/pypi/pip) ```bash # For Alpine -apk add libtool krb5-libs +apk add libtool krb5-libs krb5-dev -# For Debian/Ubuntu -apt-get install -y libltdl7 +# For Debian/Ubuntu +apt-get install -y libltdl7 libkrb5-3 libgssapi-krb5-2 -# For RHEL -dnf install -y libtool-ltdl +# For RHEL/CentOS/Fedora +dnf install -y libtool-ltdl krb5-libs + +# For SUSE/openSUSE +zypper install -y libltdl7 libkrb5-3 libgssapi_krb5-2 pip install mssql-python ``` diff --git a/mssql_python/pybind/ddbc_bindings.cpp b/mssql_python/pybind/ddbc_bindings.cpp index 8a88688a..9308d148 100644 --- a/mssql_python/pybind/ddbc_bindings.cpp +++ b/mssql_python/pybind/ddbc_bindings.cpp @@ -727,7 +727,7 @@ DriverHandle LoadDriverOrThrowException() { LOG("Failed to load driver: {}", GetLastErrorMessage()); // If this happens in linux, suggest installing libltdl7 #ifdef __linux__ - ThrowStdException("Failed to load ODBC driver. If you are on Linux, please install libltdl7 package."); + ThrowStdException("Failed to load ODBC driver. If you are on Linux, please read the documentation to install the required dependencies."); #endif ThrowStdException("Failed to load ODBC driver. Please check installation."); } From 1d463bc4369c4c198e5a88f999f5966eed03dd81 Mon Sep 17 00:00:00 2001 From: Gaurav Sharma Date: Fri, 29 Aug 2025 13:13:00 +0530 Subject: [PATCH 2/3] cleanup --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b80d651..c73c0595 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,11 @@ apk add libtool krb5-libs krb5-dev # For Debian/Ubuntu apt-get install -y libltdl7 libkrb5-3 libgssapi-krb5-2 -# For RHEL/CentOS/Fedora +# For RHEL dnf install -y libtool-ltdl krb5-libs -# For SUSE/openSUSE -zypper install -y libltdl7 libkrb5-3 libgssapi_krb5-2 +# For SUSE +zypper install -y libltdl7 libkrb5-3 libgssapi-krb5-2 pip install mssql-python ``` From d5071a3eecf2a9deaaf3e8b0bccf113ce9f9b827 Mon Sep 17 00:00:00 2001 From: Gaurav Sharma Date: Fri, 29 Aug 2025 14:14:40 +0530 Subject: [PATCH 3/3] Error message fix --- mssql_python/pybind/ddbc_bindings.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mssql_python/pybind/ddbc_bindings.cpp b/mssql_python/pybind/ddbc_bindings.cpp index 9308d148..775c3cd5 100644 --- a/mssql_python/pybind/ddbc_bindings.cpp +++ b/mssql_python/pybind/ddbc_bindings.cpp @@ -725,11 +725,7 @@ DriverHandle LoadDriverOrThrowException() { DriverHandle handle = LoadDriverLibrary(driverPath.string()); if (!handle) { LOG("Failed to load driver: {}", GetLastErrorMessage()); - // If this happens in linux, suggest installing libltdl7 - #ifdef __linux__ - ThrowStdException("Failed to load ODBC driver. If you are on Linux, please read the documentation to install the required dependencies."); - #endif - ThrowStdException("Failed to load ODBC driver. Please check installation."); + ThrowStdException("Failed to load the driver. Please read the documentation (https://github.com/microsoft/mssql-python#installation) to install the required dependencies."); } LOG("Driver library successfully loaded.");