-
Notifications
You must be signed in to change notification settings - Fork 52
Installation
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-pythonMacOS: mssql-python can be installed with pip
# For Mac, OpenSSL is a pre-requisite - skip if already present
brew install openssl
pip install mssql-pythonLinux: 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-pythonNote: If you plan to use ActiveDirectoryIntegrated authentication, the Kerberos client tools (
krb5-user,krb5-workstation, orkrb5-clientdepending on your distribution) are required for obtaining and managing Kerberos tickets. See the Microsoft Entra ID support documentation for setup details.
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.
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-pythonwheels are smaller.- For offline or air-gapped installs, download both
mssql-pythonandmssql-python-odbc(plus their dependencies) ahead of time, for example withpip download mssql-python.
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| OS | Command |
|---|---|
| Windows | myvenv\Scripts\activate |
| Mac/Linux | source myvenv/bin/activate |
This should show a prefix (myvenv) in the command prompt.
pip install mssql-python