Re: [cx-oracle-users] cx_Oracle 5.1 on OSX 10.6.7 with Instantclient 10.2 64bit
Brought to you by:
atuining
From: Chris G. <chr...@to...> - 2011-04-22 20:57:58
|
Hi Anthony - all the errors I got when using the original file are in the first email I posted. The build / install appears to work, but when trying to then import cx_Oracle I get the errors as described. Is your installation using InstantClient? Chris. On 22 April 2011 21:50, Anthony Tuininga <ant...@gm...> wrote: > Hi, > > The line numbers you provide in your description don't match the ones > that I have in my 5.1 installation....but I was able to find out where > you were referring to, I believe. And I don't believe that your > changes are necessary. You'll note on line 167 this line > > libDirs = [libPath, oracleHome] > > so you can see that the library path includes whatever ORACLE_HOME is. > I've just checked in changes to further simplify things as earlier in > the code in the CheckOracleHome() method the location of the clntsh > library is determined. > > In any case, with the base 5.1 install and the new changes I just > checked in I was able to successfully build cx_Oracle on my Mac Mini. > So I'm not sure why you needed to make the changes you did. Can you > try the vanilla one again and show me your error? Thanks. > > Anthony > > On Thu, Apr 21, 2011 at 3:24 PM, Chris Gould <chr...@to...> > wrote: > > I've fixed the problem with cx_Oracle (as I described). I vaguely > remember > > having a similar problem when I installed cx_Oracle 5.0.3 with an earlier > > version of python (2.6). The solution was the same this time. > > Because I'm using Instantclient and not a full Oracle installation, I'd > set > > ORACLE_HOME env var to my instantclient directory. > > I also set DYLD_LIBRARY_PATH to point to the InstantClient directory > (This > > needs to be made a permanent setting in .bash_profile ) > > I created the extra symlink required in the InstantClient directory : > > ln -s libclntsh.dylib.10.1 libclntsh.dylib > > I also made 2 small changes to setup.py which came with cx_Oracle5.1. > > on line 73, change > > elif sys.platform == "darwin": > > subDirs = ["lib"] > > to > > elif sys.platform == "darwin": > > subDirs = [""] > > and on line 155 change > > libPath = os.path.join(oracleHome, "lib") > > to > > libPath = os.path.join(oracleHome, "") > > Then follow the stated instructions for building and installing cx_Oracle > > The reason these changes are necessary is that if you've set ORACLE_HOME > to > > your instantclient directory, the files required are in $ORACLE_HOME not > > $ORACLE_HOME/lib as they would be with a full Oracle installation (which > is > > what setup.py is assuming). > > It'd be handy if the distributed setup.py could be modified to cater for > the > > InstantClient setup, since I guess more people these days will use this > than > > an old-skool OracleHome installation. > > Chris. > > > > On 16 April 2011 01:18, Mark Harrison <mh...@pi...> wrote: > >> > >> On 4/15/11 4:02 PM, Chris Gould wrote: > >> > Hi - > >> > I've downloaded and installed Python 2.7.1 for OSX (Intel 64 bit) > which > >> > is running fine. I've also downloaded the source code for cx_Oracle > and > >> > tried to get it working. > >> > I've followed the instructions (python setup.py build , python > setup.py > >> > install) and this seems to work OK. But when I come to try importing > >> > cx_Oracle I'm repeatedly getting the following error : > >> > > >> > > >> > >>> import cx_Oracle > >> > Traceback (most recent call last): > >> > File "<stdin>", line 1, in <module> > >> > ImportError: > >> > > dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cx_Oracle.so, > >> > 2): Symbol not found: _OCIAttrGet > >> > Referenced from: > >> > > /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cx_Oracle.so > >> > Expected in: flat namespace > >> > in > >> > > /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cx_Oracle.so > >> > > >> > I have set up the symlink in /usr/local/instantclient_10_2_64 > >> > > >> > lrwxr-xr-x 1 root staff 20 15 Apr 23:55 libclntsh.dylib -> > >> > libclntsh.dylib.10.1 > >> > -rwxr-xr-x@ 1 chris staff 25582048 31 Mar 2009 > libclntsh.dylib.10.1 > >> > > >> > > >> > I've got the following environment variables set (which some googling > >> > seems to imply might have been responsible for the problem) > >> > > >> > DYLD_LIBRARY_PATH=/usr/local/instantclient_10_2_64 > >> > LD_LIBRARY_PATH=/usr/local/instantclient_10_2_64: > >> > ORACLE_HOME=/usr/local/instantclient_10_2_64 > >> > > >> > > >> > The instantclient libraries came from Oracle's website : I've got the > >> > basic Instantclient 10.2.0.4 for 64bit OSX and also the SDK (though I > don't > >> > know if that's strictly necessary). > >> > > >> > Anyone got any ideas what's going wrong? > >> > >> In my experience, nothing but grief comes from setting environment > >> variables > >> to get oracle running. > >> > >> Here's what worked for me: > >> > >> > >> > http://stackoverflow.com/questions/684352/installing-oracle-instantclient-on-mac-os-x-without-setting-environment-variables > >> > >> HTH! > >> Mark > >> > >> > >> > ------------------------------------------------------------------------------ > >> Benefiting from Server Virtualization: Beyond Initial Workload > >> Consolidation -- Increasing the use of server virtualization is a top > >> priority.Virtualization can reduce costs, simplify management, and > improve > >> application availability and disaster protection. Learn more about > >> boosting > >> the value of server virtualization. > http://p.sf.net/sfu/vmware-sfdev2dev > >> _______________________________________________ > >> cx-oracle-users mailing list > >> cx-...@li... > >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > > > > > ------------------------------------------------------------------------------ > > Fulfilling the Lean Software Promise > > Lean software platforms are now widely adopted and the benefits have been > > demonstrated beyond question. Learn why your peers are replacing JEE > > containers with lightweight application servers - and what you can gain > > from the move. http://p.sf.net/sfu/vmware-sfemails > > _______________________________________________ > > cx-oracle-users mailing list > > cx-...@li... > > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > > > |