install cx_Oracle on Linux

step 1 : install oracle client library

    url: http://www.oracle.com/technetwork/topics/linuxsoft-082809.html

   or search:  instant clients download for Linux x86

   download:    instantclient-basic-linux-version.zip   # choose your version !!!!

                       instantclient-sdk-linux-version.zip     # header files to compile cx_Oracle

  unzip them to one directory

 

step 2: config enviroment variables

    export ORACLE_HOME=/path/to/instantclient   # must

    config LD_LIBRARY_PATH ( i used it but failed, so i edit file /etc/ld.so.conf)

    after edit ld.so.conf file, you need run ldconfig (as root)

 

step 3: install cx_Oracle

  prepare: Python.h

           yum install python-devel or  apt-get install python-dev

 cause "/usr/bin/ld: cannot find -lclntsh", you need do this 

           cd $ORACLE_HOME

           ln -s libclntsh.so.version libclntsh.so # repalce version to right num

 

now you can do this:

        pip install cx_Oracle

 

Good Luck

install cx_Oracle on Linux,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。