python-ibmdb: ImportError: DLL load failed while importing ibm_db:

“ImportError: DLL load failed while importing ibm_db” raised while executing script. Working with ibm_db version 3.1.4. Dlls are not present with 3.2.0 version.

  • Operating System Name: Microsoft Windows 11 10.0.22621

  • Python Version: 3.11.4 and 3.11.5

  • ibm_db version: 3.2.0

  • Test script to reproduce the problem Failed at line 1 import ibm_db

import ibm_db
import ibm_db_dbi
ibm_db_conn= ibm_db.connect(connectionString, "", "")
conn = ibm_db_dbi.Connection(ibm_db_conn)

Steps to Reproduce:

  1. install module via pip install --upgrade ibm_db
  2. execute script python shared in the post

About this issue

  • Original URL
  • State: open
  • Created 10 months ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

@frbelotto You need to run below command as documented here as Note:

import os
os.add_dll_directory('path to clidriver installation until bin')
import ibm_db

Also, this solution is already given in this comment: https://github.com/ibmdb/python-ibmdb/issues/887#issuecomment-1709437336 Probably, you have not read the full thread. Try it. Thanks.

Yes please as described by @dverweij-dev the expected behavior is to be platform agnostic as in version 3.1.4. Is there any specific reason to introduce this breaking change into version 3.2.0? Would you solve this point in the future?

Kind regards