This content has been marked as final. Show 2 replies
I managed to use Python 2.7 from python.org 64-bit version. I forced cx_Oracle to build only 64-bit binary and forcing to use correct Mac OS X SDK. distutils picks the wrong Mac OS X SDK, i.e. MacOSX10.6.sdk instead of MacOSX10.7.sdk. If you would check the output (OUTPUT), you can see that for the second command it's referring to both 10.6 and 10.7 SDK. Is there any problems how disutils picks Mac OS X SDK? I also import the library, but I am getting warning (WARNING). Any advices are very much welcomed.
export CFLAGS='-isysroot /Developer/SDKs/MacOSX10.7.sdk'
export ARCHFLAGS='-arch x86_64'
python2.7 setup.py build
python2.7 setup.py install
$ python2.7 setup.py build
building 'cx_Oracle' extension
gcc-4.2 -DNDEBUG -g -O3 -isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64 -I/Users/david/bin/instantclient_10_2/sdk/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c cx_Oracle.c -o build/temp.macosx-10.6-x86_64-2.7-10g/cx_Oracle.o -DBUILD_VERSION=5.1.1
gcc-4.2 -bundle -undefined dynamic_lookup -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64 build/temp.macosx-10.6-x86_64-2.7-10g/cx_Oracle.o -L/Users/david/bin/instantclient_10_2 -lclntsh -o build/lib.macosx-10.6-x86_64-2.7-10g/cx_Oracle.so -shared-libgcc
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cx_Oracle-5.1.1-py2.7-macosx-10.6-x86_64.egg/cx_Oracle.py:3: UserWarning: Module cx_Oracle was already imported from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cx_Oracle-5.1.1-py2.7-macosx-10.6-x86_64.egg/cx_Oracle.pyc, but /Users/david/bin/cx_Oracle-5.1.1 is being added to sys.path
Looks like 10.6 SDK is picked because Python was compiled using that SDK.
python-config cflags ldflags
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3
-L/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7 -u PyMacError Python.framework/Versions/2.7/Python
Edited by: user1017933 on Jan 24, 2012 5:49 AM
No, you can't use any 64bit software even your Mac is 64bit.
Oracle Instant Client should be 32bit, Python should be 32bit (export VERSIONER_PYTHON_PREFER_32_BIT=yes)