1.去官网下载最新的源码,自行编译安装
sudo python setup-py build sudo python setup.py install
2.
Oracle home does not refer to an 8i, 9i, 10g or 11g installation.
The next problem to arise was that the setup script did not recognize the version of oracle that was being used. To fix this I needed to do a slight hack on the setup script. I created the following patch that should work a treat. (Any suggestions on how to improve this would be greatly appreciated. I could add more filesToCheck for other versions of oracle, maybe adding (“11g”, “libclntsh.dylib.11.1”),
to filesToCheck for Oracle 11g for example.)
--- setup.py.bak 2008-08-25 14:13:13.000000000 +0100 +++ setup.py 2008-08-25 14:16:17.000000000 +0100 @@ -153,6 +153,11 @@("9i", "oraclient9.dll"),("8i", "oraclient8.dll")] + elif sys.platform in ("darwin"): + subDir = "" + filesToCheck = [ + ("10g", "libclntsh.dylib.10.1") + ]else:subDir = "lib"filesToCheck = [
To patch your version of setup.py save the above code into a file in the same directory as setup.py
, with the name leopard_cx_oracle.patch
. Now, execute the following to apply it:
patch < leopard_cx_oracle.patch
This should allow the setup script recognise oracle instant client for leopard and behave correctly.