开发者

cx_Oracle problem trying to import python

开发者 https://www.devze.com 2023-01-06 21:08 出处:网络
I am trying to run python in an Apache WS in a linux RHEL x86_64. After Install and configure Python2.5 and Apache, I install Oracle Instant Client (basic and sdk) in aby an .rpm file withou any prob

I am trying to run python in an Apache WS in a linux RHEL x86_64.

After Install and configure Python2.5 and Apache, I install Oracle Instant Client (basic and sdk) in a by an .rpm file withou any problem.

oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm

I set the envoirment variables

开发者_高级运维
export ORACLE_HOME=/appl/paths/instantclient_10_2
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH

Then install cx_Oracle by an .rpm file too and again withou any problem.

cx_Oracle-5.0.3-10g-unicode-py25-1.x86_64.rpm

When I try to import cx_Oracle in python I got the message

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

I google for answers without success. Any tip?


The problem was in the ORACLE_HOME, there was a misspelling on it


I solved the same problem by installing an older version of cx_Oracle (4.3.1 instead of 5.1.2). Just for future reference.

0

精彩评论

暂无评论...
验证码 换一张
取 消