Registry / database / dmpython

dmpython

JSON →
library2.5.32pypypi✓ verified 86d ago

dmPython is the official Python interface to the Dameng database, designed to facilitate connections and operations following the Python DB API 2.0 specification. It enables Python applications to directly interact with Dameng databases. The library is actively maintained by Dameng Database and currently stands at version 2.5.32, with frequent updates addressing bug fixes and new features.

pip install dmpython
INSTALL
IMPORT
SIG · DMPYTHON
D
dmpython
databasepythonv2.5.32
Install
2.6s avg
Import
10ms
Disk
44MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.5.32 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.6s · import 0.010s · 46MB
44MB installed
● package 44MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dmPython
import dmPython

This quickstart demonstrates how to establish a connection to a Dameng database, execute a simple query, fetch the result, and properly close the cursor and connection. Ensure you replace the placeholder connection details with your actual database credentials.

import dmPython import os # Replace with your actual Dameng database connection details user = os.environ.get('DM_USER', 'SYSDBA') password = os.environ.get('DM_PASSWORD', 'Dameng123') host = os.environ.get('DM_HOST', 'localhost') port = os.environ.get('DM_PORT', '5236') schema = os.environ.get('DM_SCHEMA', 'SCH1') connection_string = f'{user}/{password}@{host}:{port}/{schema}' try: conn = dmPython.connect(connection_string) cursor = conn.cursor() cursor.execute("SELECT SYSDATE FROM DUAL") result = cursor.fetchone() print(f"Current database time: {result[0]}") cursor.close() conn.close() except dmPython.DatabaseError as e: print(f"Database connection or query error: {e}")
Debug
Known issues
gotchaWhen installing dmPython from source (not via `pip install`), the Dameng Database software must be installed and the `DM_HOME` environment variable must be correctly set, as the source build depends on include headers from the DM installation directory.
fix
For source installation, ensure Dameng Database is installed and `DM_HOME` points to its installation directory. For easier installation, use `pip install dmpython` which typically uses pre-built wheels and avoids this requirement.
affects: All versions (when installing from source)
breakingOlder versions of `dmPython` (e.g., prior to 2.5.30) had known issues with multi-threaded concurrent connection release, which could lead to application instability. Similarly, versions before 2.5.26 experienced interruptions when using `executemany` with character data containing unidentifiable characters for the current encoding.
fix
Upgrade to `dmPython` version 2.5.30 or newer to benefit from fixes addressing multi-threading and `executemany` stability.
affects: < 2.5.30
gotchaBe aware that there is another distinct Python library named 'DM_Control_Python' which is used for controlling Damiao motors via CAN. Ensure you are importing and using 'dmPython' for Dameng database connectivity to avoid confusion and unexpected errors.
fix
Verify that your `import` statements and package installations specifically refer to `dmPython` for database operations.
affects: All versions
Errors
Common errors & fixes
dmPython.DatabaseError: [CODE:-70089]加密模块加载失败
The system's SSL encryption module does not meet the requirements, or the dmPython driver cannot locate the necessary SSL libraries.
fix
Update `libssl` to version 1.1 or higher. Alternatively, set the `LD_LIBRARY_PATH` (Linux) or `PATH` (Windows) environment variable to point to the `dmssl` directory located within the `dmPython` installation (e.g., `export LD_LIBRARY_PATH=/usr/local/lib/python3.13/site-packages/dmssl`).
pip install dmpython==2.4.5 fails
Specific older versions of dmPython, such as 2.4.5, have been removed from PyPI.
fix
Install the latest stable version of dmPython using `pip install dmpython` or specify a currently available version on PyPI.
Upgrade
Version history
2.5.32latest on PyPI · released Apr 13, 2026
Audit
Dependencies
Dameng Database Programmer's Interface (DPI)optionalRequired for compiling and installing dmPython from source. Not needed for pip installations using pre-built wheels.
libssl 1.1+requiredA compatible SSL encryption module is required to avoid encryption module loading failures.
Agent activity
63 hits · last 30 days
node
62
Resources
dmpython — pip install dmpython · libregistry