Fix DLL load failure on Windows , update workflow and simplify sdist packaging#1053
Open
Earammak wants to merge 6 commits intoibmdb:masterfrom
Open
Fix DLL load failure on Windows , update workflow and simplify sdist packaging#1053Earammak wants to merge 6 commits intoibmdb:masterfrom
Earammak wants to merge 6 commits intoibmdb:masterfrom
Conversation
…ages Signed-off-by: Earamma K <ek@rocketsoftware.com>
bchoudhary6415
approved these changes
Apr 8, 2026
bimalkjha
reviewed
Apr 8, 2026
_ibm_db_register_dll.py
Outdated
| if ibm_home: | ||
| candidates.append(os.path.join(ibm_home.strip('"'), "bin")) | ||
|
|
||
| # 2. User site-packages/clidriver (pip install --user) |
Member
There was a problem hiding this comment.
@bchoudhary6415 Other code should be inside else block if ibm_home is not set.
Collaborator
Author
There was a problem hiding this comment.
Ok. will correct it.
bimalkjha
requested changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses DLL resolution issues for ibm_db on Windows with Python ≥3.8. Since Python 3.8, the system PATH is no longer used for DLL resolution, which causes ImportError: DLL load failed when importing ibm_db because the clidriver DLLs cannot be found.
Problem
Python 3.8 changed DLL search behavior on Windows (Python issue #36085).
As a result, ibm_db fails to import if clidriver DLLs are not explicitly registered.
Introduce a startup hook (_ibm_db_register_dll.py) that uses os.add_dll_directory() to register the clidriver bin path automatically.
Trigger the hook via a .pth file (ibm_db_dll.pth) placed in site‑packages, ensuring DLL registration happens at Python startup.
This makes import ibm_db work out of the box on Windows without manual configuration.
updated workflow file and README.md file.