简体   繁体   中英

cx_Oracle problem trying to import python

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?

问题出现在ORACLE_HOME中,它上面有拼写错误

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM