Skip to content

Installation

Jahnvi Thakkar edited this page Aug 7, 2026 · 20 revisions

Installation Guide

Note: mssql-python is now generally available. While the driver is production-ready, we continue to add features and improvements. Please report any issues on GitHub.

Windows: mssql-python can be installed with pip

pip install mssql-python

MacOS: mssql-python can be installed with pip

# For Mac, OpenSSL is a pre-requisite - skip if already present
brew install openssl
pip install mssql-python

Linux: mssql-python can be installed with pip

# For Alpine
apk add libtool krb5-libs krb5-dev krb5 (added Kerberos client tools)

# For Debian/Ubuntu  
apt-get install -y libltdl7 libkrb5-3 libgssapi-krb5-2 krb5-user (added Kerberos client tools)

# For RHEL
dnf install -y libtool-ltdl krb5-libs krb5-workstation (added Kerberos client tools)

# For SUSE
zypper install -y libltdl7 libkrb5-3 libgssapi-krb5-2 krb5-client (added Kerberos client tools)

pip install mssql-python

Note: If you plan to use ActiveDirectoryIntegrated authentication, the Kerberos client tools (krb5-user, krb5-workstation, or krb5-client depending on your distribution) are required for obtaining and managing Kerberos tickets. See the Microsoft Entra ID support documentation for setup details.

Supported Platforms

Windows, MacOS and Linux (manylinux - Debian, Ubuntu, RHEL, SUSE (x64 only) & musllinux - Alpine)

Note: SUSE Linux ARM64 is not supported by Microsoft ODBC Driver. Use x64 architecture for SUSE deployments. Minimum supported version required for Python is version 3.10.

ODBC Driver Dependency

Starting with v1.13.0, the Microsoft ODBC driver ships in a separate package, mssql-python-odbc, rather than being bundled inside the mssql-python wheel. mssql-python declares a hard dependency on it, so pip install mssql-python still pulls the driver package automatically — no extra steps are required for a normal online install.

Note:

  • This means the driver binaries are versioned and managed independently, and mssql-python wheels are smaller.
  • For offline or air-gapped installs, download both mssql-python and mssql-python-odbc (plus their dependencies) ahead of time, for example with pip download mssql-python.

Using Virtual Environment

1. Create a virtual environment

Open a terminal (cmd / PowerShell on Windows, Terminal on Mac/Linux), switch to your working directory and run: (replace python3 with python in case of error):

python3 -m venv myvenv
2. Activate the virtual environment:
OS Command
Windows myvenv\Scripts\activate
Mac/Linux source myvenv/bin/activate

This should show a prefix (myvenv) in the command prompt.

3. Install mssql-python using pip install
pip install mssql-python

Clone this wiki locally