Python Forum
ibm_db error even though package is installed - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: ibm_db error even though package is installed (/thread-2593.html)



ibm_db error even though package is installed - runnerpaul - Mar-27-2017

Hi,

I've installed ibm_db to project interpreter but when I run my script I get the following error:

Error:
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 /Users/paulcarron/Downloads/Python/billing_extraction/Main.py 2010-01-01 2020-01-01 Carron Traceback (most recent call last):   File "/Users/paulcarron/Downloads/Python/billing_extraction/Main.py", line 5, in <module>     import ibm_db ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/ibm_db.so, 2): Library not loaded: libdb2.dylib   Referenced from: /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/ibm_db.so   Reason: image not found Process finished with exit code 1
Can anybody advise on the issue and ho to resolve it?


RE: ibm_db error even though package is installed - Larz60+ - Mar-27-2017

image not found ...
is that library supposed to contain, (or dependent on image(s))?


RE: ibm_db error even though package is installed - runnerpaul - Mar-27-2017

Sorry, I'm not sure. Python is new to me.


RE: ibm_db error even though package is installed - wavic - Mar-27-2017

See this or this or this. I hope you find a solution there.


RE: ibm_db error even though package is installed - runnerpaul - Mar-27-2017

Thanks but I've already seen them.

I tried running it through Terminal and got the following:

Error:
Thanks but I've already seen them. I tried running it through Terminal and got the following: Python Main.py Traceback (most recent call last):   File "Main.py", line 5, in <module>     import ibm_db ImportError: dlopen(/Library/Python/2.7/site-packages/ibm_db-2.0.7-py2.7-macosx-10.12-intel.egg/ibm_db.so, 2): Library not loaded: libdb2.dylib   Referenced from: /Library/Python/2.7/site-packages/ibm_db-2.0.7-py2.7-macosx-10.12-intel.egg/ibm_db.so   Reason: unsafe use of relative rpath libdb2.dylib in /Library/Python/2.7/site-packages/ibm_db-2.0.7-py2.7-macosx-10.12-intel.egg/ibm_db.so with restricted binary
Does that shed any light on the reason?

Sorry, ignore that last post. I was executing with the wrong version of Python. I get the same error in terminal as when I execute the script in PyCharm:

Error:
Traceback (most recent call last):   File "Main.py", line 5, in <module>     import ibm_db ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/ibm_db.so, 2): Library not loaded: libdb2.dylib   Referenced from: /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/ibm_db.so   Reason: image not found



RE: ibm_db error even though package is installed - Larz60+ - Mar-27-2017

Do you have a reason for using ibm_db?
I think if you don't already have code that uses DB2 or Informix you would be better off
choosing another RDBMS.
Very easy to install and use is sqlite3.
Not quite so easy to install, but i my opinion the very best of the open source RDBMS is
PostgreSQL (Especially if you plan on doing any GIS work).
And there are of course others, MySQL and more.
PostgreSQL is on par with Oracle, but it's free!


RE: ibm_db error even though package is installed - runnerpaul - Mar-28-2017

Unfortunately yes. I have an application that uses the db and I want a similar setup to do some testing.