无法让cx_Oracle与
Python版本2.7 / mac os 10.7.2(Lion)一起使用
另一件事:我已经安装了oracle 32位,不确定这是否正确.
Traceback (most recent call last):
File "reader.py",line 9,in
import cx_Oracle
File "build/bdist.macosx-10.7-intel/egg/cx_Oracle.py",line 7,in
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
他们的关键问题似乎是无法找到_OCIAttGet,我认为这意味着它无法找到lib文件或其他东西.
在网上找到,有人在谈论DYLD_LIBRARY_PATH,但我的设置,但是他在cxoracle.cfg文件中提到它,我无法找到,这是我的问题吗?
编辑
尝试使用32位模式python运行它后,我看到一个不同的错误.
Traceback (most recent call last):
File "reader.py",in
import cx_Oracle
File "build/bdist.macosx-10.7-intel/egg/cx_Oracle.py",in
File "build/bdist.macosx-10.7-intel/egg/cx_Oracle.py",line 3,in __bootstrap__
ImportError: No module named pkg_resources
>我无法在我的计算机上运行oracle 64位版本,在运行sqlplus时不断出现分段错误,这就是我使用32的原因.
第二次编辑
实际上无论我安装什么,它都不是正确的版本.. 32位版本
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位版本:
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)
我打算尝试11g,但只有64位版本.