ibm-db
Python DBI driver for DB2 (LUW, zOS, i5)
Decision gist · record as of 2026-08-14
Yes. ibm_db is production-stable (Development Status 5) with no known vulnerabilities, active maintenance (released 3 days ago), and permissive Apache 2.0 licensing. Install friction is moderate but manageable for most platforms via prebuilt wheels. Choose it if you need reliable Db2 connectivity from Python; the DB-API 2.0 wrapper provides portability. Avoid if your system has glibc < 2.34 and you cannot build from source, or if you lack Db2 server/client access.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires IBM Db2 server or client connectivity; on Linux, glibc >= 2.34 and x86_64-v2 CPU support for prebuilt wheels, or GCC compiler to build from source.
- Windows may require IBM_DB_HOME environment variable if a Db2 client is installed.
- Medium install friction: prebuilt wheels available for Linux, macOS, and Windows across Python 3.9–3.14, but source builds require a GCC compiler and ODBC headers.
License · maintenance · safety
Apache License 2.0 (permissive) — Licensed under Apache License 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
last release 2026-08-11 (3 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,008,623 downloads/mo, #2,402 on PyPI
Alternatives
Verify before relying
pip install ibm_db
import ibm_db
conn = ibm_db.connect('DATABASE=mydb;HOSTNAME=localhost;PORT=port;UID=user;PWD=pass;PROTOCOL=TCPIP', '', '')
stmt = ibm_db.exec_immediate(conn, 'SELECT * FROM table')
result = ibm_db.fetch_assoc(stmt)- Whether precompiled wheels include all necessary clidriver components for immediate use without external Db2 installation.
- Performance characteristics and connection pooling capabilities.
- Asyncio API maturity and feature completeness relative to the synchronous interface.
What it is and what it does
ibm_db is a Python driver for IBM Db2 databases (LUW and z/OS variants) that wraps the IBM Data Server Driver for ODBC and CLI. It provides two interfaces: a native ibm_db driver for direct ODBC/CLI access, and ibm_db_dbi, a DB-API 2.0-compliant wrapper for standard Python database programming. The package is actively maintained and supports Python 3.9 through 3.14 across Linux, macOS (including ARM64 from 3.9 onwards), Windows, and Unix platforms.
Installation is straightforward via pip for most platforms—prebuilt wheels bundle the clidriver, eliminating external dependencies for typical setups. However, on Linux systems with older glibc or CPUs predating 2009, or when using an external Db2 client installation, you must build from source, which requires a GCC compiler and ODBC headers. Windows users with an existing Db2 client may need to configure the IBM_DB_HOME environment variable. The package handles Windows DLL resolution automatically via a .pth file, though manual fallback configuration is documented if needed.
Use it for
- Connect Python applications to IBM Db2 LUW databases for transactional workloads and reporting.
- Execute SQL queries and stored procedures against Db2 z/OS mainframe databases from Python scripts.
- Build DB-API 2.0-compliant applications using ibm_db_dbi for portable Db2 access.
- Migrate legacy Db2 applications to Python while maintaining existing database infrastructure.
- Integrate Db2 data into Python data pipelines and analytics workflows.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
ibm_db is production-stable (Development Status 5) with no known vulnerabilities, active maintenance (released 3 days ago), and permissive Apache 2.0 licensing. Install friction is moderate but manageable for most platforms via prebuilt wheels. Choose it if you need reliable Db2 connectivity from Python; the DB-API 2.0 wrapper provides portability. Avoid if your system has glibc < 2.34 and you cannot build from source, or if you lack Db2 server/client access.
Install
ibm-db on PyPI
Before you install
Medium install friction: prebuilt wheels available for Linux, macOS, and Windows across Python 3.9–3.14, but source builds require a GCC compiler and ODBC headers. Linux wheels require glibc >= 2.34 and x86_64-v2 CPU support; older systems must build from source. Windows users may need to set IBM_DB_HOME if a Db2 client is already installed.
Requires IBM Db2 server or client connectivity; on Linux, glibc >= 2.34 and x86_64-v2 CPU support for prebuilt wheels, or GCC compiler to build from source. Windows may require IBM_DB_HOME environment variable if a Db2 client is installed.
License in practice
Licensed under Apache License 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
Quickstart
pip install ibm_db
import ibm_db
conn = ibm_db.connect('DATABASE=mydb;HOSTNAME=localhost;PORT=port;UID=user;PWD=pass;PROTOCOL=TCPIP', '', '')
stmt = ibm_db.exec_immediate(conn, 'SELECT * FROM table')
result = ibm_db.fetch_assoc(stmt)
Verify before relying
- Whether precompiled wheels include all necessary clidriver components for immediate use without external Db2 installation.
- Performance characteristics and connection pooling capabilities.
- Asyncio API maturity and feature completeness relative to the synchronous interface.
Package facts
| License | Apache License 2.0 permissive |
| Python support | Not specified |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 3 days since the last release |
| First released | |
| Downloads | 4,008,623 / month, #2,402 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: Windows :: Windows 10Operating System :: Microsoft :: Windows :: Windows 11Operating System :: POSIX :: AIXOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Database :: Front-Ends |
Evidence: ibm_db-3.3.0-cp310-cp310-macosx_10_15_x86_64.whl; ibm_db-3.3.0-cp310-cp310-macosx_14_0_arm64.whl; ibm_db-3.3.0-cp310-cp310-manylinux_2_34_i686.whl; ibm_db-3.3.0-cp310-cp310-manylinux_2_34_x86_64.whl; ibm_db-3.3.0-cp310-cp310-win32.whl; ibm_db-3.3.0-cp310-cp310-win_amd64.whl; ibm_db-3.3.0-cp311-cp311-macosx_10_15_x86_64.whl; ibm_db-3.3.0-cp311-cp311-macosx_14_0_arm64.whl; ibm_db-3.3.0-cp311-cp311-manylinux_2_34_i686.whl; ibm_db-3.3.0-cp311-cp311-manylinux_2_34_x86_64.whl; ibm_db-3.3.0-cp311-cp311-win32.whl; ibm_db-3.3.0-cp311-cp311-win_amd64.whl; ibm_db-3.3.0-cp312-cp312-macosx_10_15_x86_64.whl; ibm_db-3.3.0-cp312-cp312-macosx_14_0_arm64.whl; ibm_db-3.3.0-cp312-cp312-manylinux_2_34_i686.whl; ibm_db-3.3.0-cp312-cp312-manylinux_2_34_x86_64.whl; ibm_db-3.3.0-cp312-cp312-win32.whl; ibm_db-3.3.0-cp312-cp312-win_amd64.whl; ibm_db-3.3.0-cp313-cp313-macosx_10_15_x86_64.whl; ibm_db-3.3.0-cp313-cp313-macosx_14_0_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “IBM Db2 database driver”
- ibm-dbPython driver for connecting to IBM Db2 for LUW and IBM Db2 for z/OS…
- ibm-db-saSQLAlchemy dialect adapter that enables Python applications to…
- sqlalchemy-ibmiProvides a SQLAlchemy dialect to connect to Db2 on IBM i systems…
Give your agent the search over MCP, or paste the wish link into any chat.
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object Relational Mapper (ORM) that provides both a high-level ORM layer for declarative object persistence and a Core SQL construction system for direct database abstraction and query building.
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Alembic generates and manages database schema migrations for SQLAlchemy applications, handling version control of database structure changes with support for upgrades, downgrades, and auto-generation from model changes.
Install it if you use SQLAlchemy and need to version-control schema changes; skip it only if you manage migrations manually or use a different ORM entirely.
A Python client library for connecting to and querying Weaviate, a vector database that enables semantic search and AI-powered data retrieval.
A Python client library that connects to Databricks clusters and SQL warehouses using a Thrift-based protocol, conforming to the Python DB API 2.0 specification and supporting Arrow-based data exchange.
Install it if you need to query Databricks clusters or SQL warehouses from Python.
Psycopg 3 is a PostgreSQL database adapter for Python that enables applications to connect to, query, and manage PostgreSQL databases using Python code.
Install it if you need to connect Python to PostgreSQL.
See also ibm-db-sa · sqlalchemy-ibmi · pyodbc · sqlalchemy-jdbcapi · databricks-dbapi · aerospike · JayDeBeApi · sqlalchemy-firebird · pg8000 · mssql-python-odbc