Ubuntu cx_oracle Installation notes
(1) $ sudo apt-Get install Python-dev // for some versions without python. h
(2) http://cx-oracle.sourceforge.net/download source code only. My version is
Cx_Oracle-5.0.tar.gz.
$ Tar zxvf cx_Oracle-5.0.tar.gz
$ Cx_Oracle-5.0 CD
$ Setup Python build
$ Setup Python install // This step prompts that the permission is insufficient.
Change to root user # setup Python install
(3) >>> import cx_oracle
Importerror: libclntsh. so.10.1: cannot open shared object file: no such file or directory
$ Locate libclntsh. so.10.1
/Home/Oracle/ora10/lib/libclntsh. so.10.1
According to the build.txt documentation, you must set the environment variables ORACLE_HOME and LD_LIBRARY_PATH.
Add the following in the. bashrc file:
Export ORACLE_HOME =/home/Oracle/ora10/
Export LD_LIBRARY_PATH =/home/Oracle/ora10/lib: $ LD_LIBRARY_PATH
$ Source. bashrc
Problem Solving
Note:
I have installed Oracle and python on a local machine, so there is no client installation problem. you need to download the instantclient basic version from the Oracle website, and then ln-s libclntsh. so. x. X libclntsh. so (this has not been tried)