Download the following from Instant Client Downloads
After downloading, install the rpm package.
$ sudo rpm -ivh oracle-instantclient-basic-10.2.0.5-1.x86_64.rpm
$ sudo rpm -ivh oracle-instantclient-devel-10.2.0.5-1.x86_64.rpm
$ sudo rpm -ivh oracle-instantclient-sqlplus-10.2.0.5-1.x86_64.rpm
export ORACLE_HOME=/usr/lib/oracle/10.2.0.5/client64
export PATH=$PATH:$ORACLE_HOME/bin
sudo ln -s /usr/include/oracle/10.2.0.5/client64 /usr/lib/oracle/10.2.0.5/client64/include
$ sudo vim /etc/ld.so.conf.d/oracle.conf
Write the following:
/usr/lib/oracle/10.2.0.5/client64/lib/
After saving, execute the following command
$ sudo /sbin/ldconfig
$ /usr/local/python2.7/bin/python setup.py build
$ sudo cp build/lib.linux-x86_64-2.7-10g/cx_Oracle.so /usr/local/python2.7/lib/python2.7/site-packages/
$ /usr/local/python2.7/bin/python
>>>import cx_Oracle
>>>
Recommended Posts