Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python DB2 - Symbol not found

Tags:

python

db2

After updating to Mac Catalina (version 10.15.6), I had to re-install Python and all dependent modules. My problem now is that when adding the module ibm_db, I get the following error message when trying to run my program:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ibm_db.cpython-37m-darwin.so, 2): Symbol not found: ___cxa_throw_bad_array_new_length
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/clidriver/lib/libdb2.dylib
  Expected in: /usr/lib/libstdc++.6.dylib
 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/clidriver/lib/libdb2.dylib

I am using PyCharm 2018.3.7 (CE).

Anyone that has seen this, and have a fix for this?

like image 450
Kjetil Laugsand Avatar asked Nov 22 '25 10:11

Kjetil Laugsand


1 Answers

The problem is due to older version of /usr/lib/libstdc++.6.dylib installed in your system. New installation of ibm_db is looking for newer version of libstdc++.6.dylib.

There are two quick solution for it. You can use either one:

  1. Install new gcc of version >= 8 in your system and set environment variable to use it so that libstdc++.6.dylib from new version of gcc should get picked up instead of existing old one.

OR,

  1. export DYLD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/clidriver/lib

Thanks.

like image 199
Bimal Jha Avatar answered Nov 24 '25 23:11

Bimal Jha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!