connect-from-python
Installation
SKILL.md
Connect from Python
The Python answer changed. There are now two supported drivers, and the newer one removes the step that causes most Python connection failures: installing an ODBC driver into the operating system.
Checked on 2026-09-03 against pyodbc 5.3.0, msodbcsql18 18.6.2.1 and unixODBC 2.3.14 on this machine, and the current documentation for mssql-python 1.13.0.
This skill owns driver choice, installation, connection string shape, pooling and Entra ID for
Python. Encryption doctrine, retry and the first-connect error on a paused database are the same in
every language and live in connect-to-azure-sql. SQLAlchemy is sqlalchemy-azure-sql.
Choose the driver first
mssql-python 1.13.0 |
pyodbc 5.3.0 |
|
|---|---|---|
| Who ships it | Microsoft, first-party | Community, long-standing |
| Python required | 3.10 or later | 3.9 or later |
| Operating system install | None. mssql-python-odbc carries the driver binaries |
msodbcsql18 and a driver manager, per distribution |
Entra ActiveDirectoryDefault |
Yes, and azure-identity comes with it |
No, see below |