cx_Oracle问题:尝试导入Python时出现了问题。

3
我将尝试在Linux RHEL x86_64的Apache Web服务器上运行Python。
安装和配置了Python2.5和Apache之后,我通过.rpm文件顺利地安装了Oracle Instant Client(基本版和SDK)。
oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm

我已经设置了环境变量。
export ORACLE_HOME=/appl/paths/instantclient_10_2
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH

然后,也可以通过.rpm文件安装cx_Oracle,而且没有任何问题。
cx_Oracle-5.0.3-10g-unicode-py25-1.x86_64.rpm

当我尝试在Python中导入cx_Oracle时,出现以下消息:

Python 2.5.2 (r252:60911, Jul  1 2010, 17:47:36)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /appl/paths/python2.5/site-packages/cx_Oracle.so: undefined symbol: OCIDBShutdown

我在谷歌上搜索了答案,但没有成功。有什么提示吗?

http://agiletesting.blogspot.com/2005/05/installing-and-using-cxoracle-on-unix.html - miku
Oracle Instant Client运行正常,我能够连接数据库,但是我仍然无法安装cx_Oracle。我认为这可能是与Linux库python-devel(python-devel-2.4.3-27.el5.x86_64.rpm)有关的问题。这个库与python2.5不兼容,而且我找不到适用于python-devel-2.5的rpm包。 - Bruno Nx
2个回答

1
问题出在ORACLE_HOME上,拼写有误。

0

我通过安装较旧版本的cx_Oracle(4.3.1而不是5.1.2)解决了相同的问题。仅供参考。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接