Python script and modules.

I am running a python script as follows from a shell script and getting an error as the following. Can anybody help to sort it out.

++ ORACLE_HOME=/opt/oracle
++ JAVA_HOME=/usr/local/jdk1.5
++ LD_LIBRARY_PATH=/usr/lib:/lib:/usr/ucblib:/opt/oracle/lib32:/usr/local/lib:/vobs/gtx1/libsolaris
++ export PATH ORACLE_HOME JAVA_HOME LD_LIBRARY_PATH UDE_HOME UDE_CSV_FOLDER
+ cd /opt/app/tools/UDE/UserDataExtract-11.01.18/deploy/scripts
+ python UdeManager.py
Traceback (most recent call last):
  File "UdeManager.py", line 16, in <module>
    import UdeProcessReqFile
  File "/opt/app/tools/UDE/UserDataExtract-11.01.18/deploy/scripts/UdeProcessReqFile.py", line 18, in <module>
    import UdeExtractService
  File "/opt/app/tools/UDE/UserDataExtract-11.01.18/deploy/scripts/UdeExtractService.py", line 13, in <module>
    import UdeDatabaseService
  File "/opt/app/tools/UDE/UserDataExtract-11.01.18/deploy/scripts/UdeDatabaseService.py", line 5, in <module>
    import cx_Oracle
ImportError: /usr/local/lib/python2.5/site-packages/cx_Oracle.so: wrong ELF class: ELFCLASS32
+ exit 0

Several possibilities. First, the Oracle library is compiled fir a different architecture than the host you are running on. Do an "arch" and compare it's output to "file librarypath". You might be on a Sparc but Oracle is compiled for i386. Even i686 and x86_64 can clash.

Second, it's not the hardware chipset causing the incompatibility, but the OS (Solaris vs Linux or Linux vs BSD).

Third, the Oracle binary has been corrupted.

The solution for all these is the same: (re)install tge Oracle-python support
Libraries for your hardware and OS.

from the error message, I guess you have a 64-bit Os, and
cx_Oracle.so
was somehow compiled with 32-bit.
ELF indicates the Executable and Linkable Format. ELFCLASS32 means that it's a 32-bit ELF file.