[Pythonmac-SIG] Compiling cx_Oracle

stv stvsmth at gmail.com
Fri Jul 27 05:36:07 CEST 2007


I am trying to compile cx_Oracle for my Intel Mac 10.4.9 / Python
2.4.4 installation, but when I import the compile .so file I get
ImportError: Failure linking new module (Detail below).

I have the Oracle instant client installed, including the SDK package
for the header files. In order to pacify the compiler warnings, I
created symbolic links for the two dylibs that ended in 10.1

/Applications/instantclient/libclntsh.dylib@ -> libclntsh.dylib.10.1
/Applications/instantclient/libocci.dylib@ -> libocci.dylib.10.1

The following builds the cx_Oracle.so and installs it into
site-packages, but the import fails as follows:

$ sudo python setup.py install
running install
running build
running build_ext
running install_lib

$ python
Python 2.4.4 (#1, May 21 2007, 11:26:22)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: Failure linking new module:
/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/cx_Oracle.so:
Symbol not found: _OCINumberFromInt
  Referenced from:
/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/cx_Oracle.so
  Expected in: dynamic lookup

>>>

I've  stepped out of my aging compiler expertis.... er, memories.
Dynamically linked libraries, statically linked libraries, it's all a
blur now. Tis what I love about Python : )

Any tips are appreciated. I found only one page Googling about (which
gave me symbolic link tip)
http://pedro.emanuel.familiasalgado.org/?p=103

--stv


More information about the Pythonmac-SIG mailing list