python ibm_db post install script does not seem to work from Anaconda

Skip to first unread message

Apr 19, 2019, 11:34:08 PM4/19/19
to Anaconda - Public
I have added a post install class that's working fine when I do "pip install ibm_db" on MAC from a standalone python installation. However, when I use the python/pip from anaconda3(python 3.7), the same pip is not executing the post install script.
Can some one please take a look and assist.
The class can be seen at:

Post install, I am expecting following output:
BLR-D-MACOS03:site-packages skauser$ otool -L
        @loader_path/clidriver/lib/libdb2.dylib (compatibility version 0.0.0, current version 0.0.0)

When executing from Anaconda, the name of libdb2.dylib is unchanged.

The behavior is specific to anaconda when I use the python/pip that comes with it. When I use the pip from anaconda, e.g:/Users/skauser/anaconda3/bin/pip pip install ibm_db Installation is success,but when I import ibm_db, I get this error import ibm_db >>> import ibm_db Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: dlopen(/Users/skauser/anaconda3/lib/python3.7/site-packages/, 2): Library not loaded: libdb2.dylib Referenced from: /Users/skauser/anaconda3/lib/python3.7/site-packages/ Reason: image not found Reason being, the post install script of my is not executed and hence following command did not run post install . for so in glob.glob(get_python_lib()+r'/ibm_db*.so'): os.system("install_name_tool -change libdb2.dylib {}/lib/libdb2.dylib {}".format(clipath, so)) Can be seen at However, when I use the standalone python installation that is outside of anaconda distribution, pip install correctly runs the post install script ibm_db's /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ibm_db >>

Another thing to note is that, when I build the source using "python build" & install via "python install", the install_name_tool is correctly
able to rename the library name.

This is blocking the seamless adoption of python ibm_db as many users in developer community are using anaconda.
Kindly help!

Sanket B.

Jun 3, 2021, 12:53:32 AMJun 3
to Anaconda - Public,
hey i have similar error. if your error is resolved then please help me to solve my error.
Reply all
Reply to author
0 new messages