This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sabakauser
Recipients sabakauser, xtreak
Date 2019-04-16.10:01:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1555408918.99.0.887990377305.issue36640@roundup.psfhosted.org>
In-reply-to
Content
Thanks Karthikeyan.

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/ibm_db.cpython-37m-darwin.so, 2): Library not loaded: libdb2.dylib
  Referenced from: /Users/skauser/anaconda3/lib/python3.7/site-packages/ibm_db.cpython-37m-darwin.so
  Reason: image not found

Reason being, the post install script of my setup.py 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 
https://github.com/ibmdb/python-ibmdb/blob/master/IBM_DB/ibm_db/setup.py#L58

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 setup.py.

/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
>>

The error Reason: image not found is specific to MAC due to its security setting and I have added a workaround that is expected to work with pip install. However, it does not seem to work.
History
Date User Action Args
2019-04-16 10:01:59sabakausersetrecipients: + sabakauser, xtreak
2019-04-16 10:01:58sabakausersetmessageid: <1555408918.99.0.887990377305.issue36640@roundup.psfhosted.org>
2019-04-16 10:01:58sabakauserlinkissue36640 messages
2019-04-16 10:01:58sabakausercreate