Can't get cx_Oracle to work with Python version 2.7 / mac os 10.7.2 (Lion)
One other thing: I have installed oracle 32 bit, not sure if that was correct.
Traceback (most recent call last):
File "reader.py", line 9, in <module>
import cx_Oracle
File "build/bdist.macosx-10.7-intel/egg/cx_Oracle.py", line 7, in <module>
File "build/bdist.macosx-10.7-intel/egg/cx_Oracle.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/me/.python-eggs/cx_Oracle-5.1.1-py2.7-macosx-10.7-intel.egg-tmp/cx_Oracle.so, 2): Symbol not found: _OCIAttrGet
Referenced from: /Users/me/.python-eggs/cx_Oracle-5.1.1-py2.7-macosx-10.7-intel.egg-tmp/cx_Oracle.so
Expected in: flat namespace
in /Users/me/.python-eggs/cx_Oracle-5.1.1-py2.7-macosx-10.7-intel.egg-tmp/cx_Oracle.so
They key problem seems to be not being able to locate _OCIAttGet
, and I think this means that it cant find a lib file or something.
Found on the web, someone talking about DYLD_LIBRARY_PATH
, but mine is set, however he mentioned it in cxoracle.cfg
file, that I can not locate, is this my problem?
EDIT
After trying to run it with 32 bit mode python, I see a different error.
Traceback (most recent call last):
File "reader.py", line 9, in <module>
import cx_Oracle
File "build/bdist.macosx-10.7-intel/egg/cx_Oracle.py", line 7, in <module>
File "build/bdist.macosx-10.7-intel/egg/cx_Oracle.py", line 3, in __bootstrap__
ImportError: No module named pkg_resources
- I could not get the oracle 64 bit versions to run on my computer, kept getting segmentation faults when i ran sqlplus, so thats why I am using the 32.
SECOND EDIT
Actually no matter what i install, it is not the right version.. 32 bit version
ld: warning: ignoring file /opt/oracle/instantclient10_2/libclntsh.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
64 bit version:
ld: warning: ignoring file /opt/oracle/instantclient10_2/libclntsh.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
I am going to try 11g, but that only has a 64 bit version.
See Question&Answers more detail:
os