Troubles With Pydev And External Libraries In Os X
Solution 1:
In eclipse, set the following ‘environment variables’ under ‘PyDev’, Interpreter – Python (or which ever you are using).
- ORACLE_HOME=[your installation path]/instantclient_10_2
- LD_LIBRARY_PATH=$ORACLE_HOME
- DYLD_LIBRARY_PATH=$ORACLE_HOME
It worked for me.
Solution 2:
Don't know if you have fixed this yet, but from the comments it looks like you have a 32 / 64 bit issue going on somewhere along the line.
cx_Oracle.so is a universal binary with PPC, 32 and 64 bit Intel versions inside, but from your comment your result for libclntsh.dylib.10.1 differs from mine
file libclntsh.dylib.10.1
libclntsh.dylib.10.1: Mach-O 64-bit dynamically linked shared library x86_64
while I get the same result as you if I run the same command against the 32 bit client (which I keep in a separate directory)
file libclntsh.dylib.10.1
libclntsh.dylib.10.1: Mach-O dynamically linked shared library i386
I am guessing that when running from the command line it is either using a different path and picking up the appropriate libclntsh, or that running through Eclipse is causing it to run in the opposite mode from command line.
Solution - download both 32 and 64 bit versions of Instant Client from Oracle, but in differently named directories, and control which one is used by using links.
If you are feeling brave, you could do the job Oracle failed to do and merge the two dylib into a Universal binary.
http://developer.apple.com/mac/library/technotes/tn2005/tn2137.html#TNTAG3
Solution 3:
I had a similar issue with cx_Oracle and Eclipse: Everything worked in Terminal, same no suitable image error
in Eclipse. This was definitely an binary compatibility issue (for me, it was 32- vs 64-bit).
JulesLt had the solution when he referenced the developer site. I used the lipo
option detailed in that document. It was remarkably easy. As we have developers using both 32-bit and 64-bit installations, we already had an instantclient built for each (no PPC machines here).
Assuming the sibling directories of instantclient_32
, instantclient_64
and instantclient_fat
—where instantclient_fat
is just a copy of either the 32- or 64-bit directory—the following should do the trick:
cd instantclient_32 ; for f in `ls *dylib* genezi sqlplus` ; do lipo -create $f ../instantclient_64/$f -output ../instantclient_fat/$f ; done
The above will overwrite the relevant executables in instantclient_fat
with the fat binaries. Once you have done this, build cx_Oracle
against this instantclient
library and voilà.
Thanks to JulesLt ... this solved a number of annoying issues.
Post a Comment for "Troubles With Pydev And External Libraries In Os X"