'DLL load failed while importing ibm_db: The application has failed to start because its side-by-side configuration is incorrect. ImportError

I ran the code below in my jupyter notebook while trying to link my ibm_db to my notebook to carry out SQL queries in Python

%sql ibm_db_sa://uid:pswd@hostname/database

After running the code with the right parameters, I got this error message as the output.

               postgresql://username:password@hostname/dbname
               or an existing connection: dict_keys(['sqlite://'])
DLL load failed while importing ibm_db: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
Connection info needed in SQLAlchemy format, example:
               postgresql://username:password@hostname/dbname
               or an existing connection: dict_keys(['sqlite://'])

I then tried to import ibm_db but here is the error message i got

ImportError                               Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_15064/2090327380.py in <module>
----> 1 import ibm_db

c:\users\user\appdata\local\programs\python\python39\lib\site-packages\ibm_db_dlls\ibm_db.dll in <module>

c:\users\user\appdata\local\programs\python\python39\lib\site-packages\ibm_db_dlls\ibm_db.dll in __bootstrap__()

c:\users\user\appdata\local\programs\python\python39\lib\imp.py in load_dynamic(name, path, file)
    340         spec = importlib.machinery.ModuleSpec(
    341             name=name, loader=loader, origin=path)
--> 342         return _load(spec)
    343 
    344 else:

ImportError: DLL load failed while importing ibm_db: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

I have checked that all my python, SQL and IBM packages are up to date. I have also checked other solutions on stack overflow that could be related to this but none were related to this problem in particular. Some of the solutions provided in other problems were either out of date or not solving the problem at hand.

Any ideas on how to solve this error will be appreciated. Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source