No better time for reinstating the technical blogging I used to do, than when you just finished banging you head against the wall for three days trying to install a package.
I have been tasked with setting up new Django multi-site hosting servers at Rice. Our old ones are running RH4 and have pretty much fallen out of best practice in Python application hosting terms. Yes, very system administrator of me…
Our Banner system is built on an Oracle database. We have a lot of applications that depend on this Oracle database for all sorts of goodies, particularly student/staff/faculty information.
To use an Oracle database with Django, one must do a simple:
> pip install cx-oracle
But wait! Oracle libraries are needed for this to work! Here’s how I installed them on a RH7 box.
Download from Oracle:
oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
Install:
> rpm -ivh oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
>rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
> rpm -ivh oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
Add the following to you ~/.bashrc (changing path if necessary):
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_RUN_PATH=$ORACLE_HOME/lib
** The LD_RUN_PATH is what you won’t find in most tutorials and without this cx_Oracle will through a huge fit when used inside a virtualenv. This must be set before attempting to install cx-oracle through pip. If you’ve already installed it, make sure you ‘pip uninstall cx-oracle’ and reinstall.
Run, to make changes take effect in current shell:
> source ~/.bashrc
NOW you may:
> pip install cx-oracle