我需要在 Linux (Linux 2.6.18-371.1.2.el5 i686) 上安装 cx_Oracle for Python 2.5。我已经安装了Oracle客户端10.2.0.4。
我尝试过以下操作:
1. 下载cx_Oracle tar.gz
from http://sourceforge.net/projects/cx-oracle/files/
。
我不知道列出的哪个版本适合python 2.5和Oracle客户端10.2.0.4,所以尝试cx_Oracle-5.1.tar.gz。解压后的焦油,
转到解压的文件夹并运行 python setup.py install。我收到错误:
Traceback (most recent call last):
File "setup.py", line 187, in <module>
raise DistutilsSetupError("cannot locate Oracle include files")
distutils.errors.DistutilsSetupError: cannot locate Oracle include files
在.bash_profile中我设置了oracle路径:
export ORACLE_HOME=/usr/oracle/10.2.0.4/client
export PATH=$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
如何修复此类错误,也许我需要另一个版本的 cx_Oracle tar?
- 运行 pip install cx_Oracle。出现错误:
下载/解压 cx-Oracle
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement cx-Oracle
No distributions at all found for cx-Oracle
有人可以告诉我正确的解决方案吗?
Update在回复建议后,我收到以下错误:
...
cx_Oracle.c:496: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
cx_Oracle.c:497: error: âOCI_UCBTYPE_EXITâ undeclared (first use in this function)
cx_Oracle.c:497: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
cx_Oracle.c:498: error: âOCI_UCBTYPE_REPLACEâ undeclared (first use in this function)
cx_Oracle.c:498: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
error: command 'gcc' failed with exit status 1