问题
So I followed these directions here to install Oracle InstantClient,
installing Oracle Instantclient on Mac OS/X without setting environment variables?
But when I try to install cx_oracle I get the following stack trace,
python setup.py build
running build
running build_ext
building 'cx_Oracle' extension
creating build
creating build/temp.macosx-10.6-universal-2.6-10g
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -I/usr -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c cx_Oracle.c -o build/temp.macosx-10.6-universal-2.6-10g/cx_Oracle.o -DBUILD_VERSION=5.1.1
creating build/lib.macosx-10.6-universal-2.6-10g
gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc -arch x86_64 build/temp.macosx-10.6-universal-2.6-10g/cx_Oracle.o -L/usr/lib -lclntsh -o build/lib.macosx-10.6-universal-2.6-10g/cx_Oracle.so -shared-libgcc
ld: library not found for -lclntsh
collect2: ld returned 1 exit status
ld: library not found for -lclntsh
collect2: ld returned 1 exit status
ld: library not found for -lclntsh
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/5Q/5QMpI35VGumn0wxJwdndr-r4BJ+/-Tmp-//ccG0USbB.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
What am I doing wrong here? Did I miss something when I followed the InstantClient installation?
List of libs copied
bnnz10.dylib
libociei.dylib
libsqlplusic.dylib
libclntsh.dylib.10.1
libocci.dylib.10.1
libocijdbc10.dylib
libsqlplus.dylib
回答1:
You have not got a clntsh library to link against
To fix this you need in /usr/lib to link libclntsh.dylib.10.1 to libclntsh.dylib and libocci.dylib.10.1 to libocci.dylib
Note that I don't have the oracle library and so cannot confirm this will be sufficient.
来源:https://stackoverflow.com/questions/8579715/cx-oracle-osx-install-error