wmjie / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

OS X 10.7: import ibm_db fails with Symbol not found: _SQLAllocHandle #126

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install IBM Data Service driver for ODBC - CLI
2. Install ibm_db using easy_install
   Note am using virtualenv, so the install is NOT going into the default OS X Python 2.7 library
3. Set environment variables as recommended
4. Run Python (2.7) and attempt to import ibm_db

What is the expected output? What do you see instead?
Instead of successful import, receiving the following error:

Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ibm_db
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: 
dlopen(/Users/TedM/pyEnvs/DB/lib/python2.7/site-packages/ibm_db.so, 2): Symbol 
not found: _SQLAllocHandle
  Referenced from: /Users/TedM/pyEnvs/DB/lib/python2.7/site-packages/ibm_db.so
  Expected in: flat namespace
 in /Users/TedM/pyEnvs/DB/lib/python2.7/site-packages/ibm_db.so

What version of the product are you using? On what operating system?
OS X 10.7.5
Python 2.7
ibm_data_server_driver_package_linuxx64_v10.1.tar.gz.

I extracted ibm_data_server_driver_for_odbc_cli.tar.Z as recommended in the 
answer to Issues 63, and also set the environment variables as recommended:

export IBM_DB_DIR=/Users/TedM/IBM/clidriver
export IBM_DB_LIB=/Users/TedM/IBM/clidriver/lib

then ran easy_install ibm_db and set the final environment variable:

export LD_LIBRARY_PATH=/Users/TedM/IBM/clidriver/lib:$LD_LIBRARY_PATH

Note, ideally I'd like to have a configuration for DB2 9.7 - have also tried 
the latest FP Data Server Driver for 9.7 and had the same problem.

Any help you can offer is most appreciated.

Please provide any additional information below.

I note a number of warnings during the install;  see document attached

Original issue reported on code.google.com by tmorris0...@gmail.com on 18 Feb 2013 at 10:41

Attachments:

GoogleCodeExporter commented 9 years ago
You are getting these errors since you are using DS driver of Linux OS.

DS driver for Mac OS is not available, The DB2 Express-c edition is available 
for mac OS, you can find the same at 
http://www-01.ibm.com/software/data/db2/express-c/download.html.

If you are using Mac OS as client then you need to install DB2 Express-C 10.1 
for Mac OS X. If your DB2 server is also in the same system then you already 
have all the necessary libraries. 
You needs to reinstall ibm_db after setting IBM_DB_HOME environment variable to 
<path_to_sqllib>, and set the DYLD_LIBRARY_PATH environment variable to 
<path_to_sqllib/lib64>.

Original comment by rahul.pr...@in.ibm.com on 19 Feb 2013 at 6:09

GoogleCodeExporter commented 9 years ago
Thanks for this information, I will try this right away.  One more question:  
in the end, I need to connect to a remote DB2 9.7 instance.  (a) Will the 10.1 
libraries connect to a DB2 9.7 instance?  (b) Do I need any other libraries to 
support access to a remote system? (OK, that was actually 2 questions :-)

Best, Ted

Original comment by tmorris0...@gmail.com on 19 Feb 2013 at 12:06

GoogleCodeExporter commented 9 years ago
>>>
(a) Will the 10.1 libraries connect to a DB2 9.7 instance?
<<<
 Yes, It will connect to DB2 9.7 instance also.

>>>
 (b) Do I need any other libraries to support access to a remote system? (OK, that was actually 2 questions :-)
<<<
No, But if your DB2 server is on z/OS or i5/OS then license file is required.

Original comment by rahul.pr...@in.ibm.com on 19 Feb 2013 at 12:14

GoogleCodeExporter commented 9 years ago
Hello Rahul,

I have encountered all sorts of problems installing DB2 Express (very odd 
things, according to IBM support) so have moved over to a Windows 7 environment.

I successfully installed the Driver Pack and have *nearly* gotten ibm_db to 
install.  

When I run pip install ibm_db, I get an error in msvc9compiler.py.  The pip log 
is attached.  (Note same failure occurs with easy_install).

Environment:
Windows 7
Python 2.7
MS Visual Studio Express 2008 FP 1

Original comment by tmorris0...@gmail.com on 20 Feb 2013 at 2:54

Attachments:

GoogleCodeExporter commented 9 years ago
Yet we didn't have build and tested 64-bit ibm_db extension on window platform.

 64-bit window build  required specific VS 2008 standard edition(VS express edition will not work), you can get help to build 64-bit extension from http://mattptr.net/2010/07/28/building-python-extensions-in-a-modern-windows-environment/ and http://www.freia.jp/taka/blog/python-win32-binary-building-and-x64-cross-compiling-on-32bit-platform/index.html

Original comment by rahul.pr...@in.ibm.com on 13 May 2013 at 6:19

GoogleCodeExporter commented 9 years ago
64-bit window build egg files are now available at 
https://pypi.python.org/pypi/ibm_db/.

Original comment by rahul.pr...@in.ibm.com on 17 Jun 2013 at 6:22