Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError with ibm_db > version 3.2.0 #223

Closed
amochin opened this issue Oct 1, 2024 · 1 comment
Closed

ImportError with ibm_db > version 3.2.0 #223

amochin opened this issue Oct 1, 2024 · 1 comment
Assignees

Comments

@amochin
Copy link
Collaborator

amochin commented Oct 1, 2024

The library works fine with ibm_db 3.1.4, but returns an error with ibm_db 3.2.0 and newer - ImportError: DLL load failed while importing ibm_db.

This is a known windows specific issue - ibmdb/python-ibmdb#887

The solution offered by IBM is to manually add the CLI driver path to the list of DLL libs:

import os
os.add_dll_directory('path to clidriver installation until bin')
import ibm_db
@amochin amochin self-assigned this Oct 1, 2024
@amochin amochin closed this as completed in 26365e1 Oct 1, 2024
@amochin
Copy link
Collaborator Author

amochin commented Oct 1, 2024

Fixed in v.2.0.2.
Although I consider the solution from IBM rather as a workaround, I've implemented it in the Database Library.

If running on Windows and with ibm_db or ibm_db_dbi module, the library determines current installation path of the module, adds clidriver/bin to it and adds the result to list of DLL's using os.add_dll_directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant