How to Install Python cx_Oracle module on Unix/AIX Server.
In this post, we will see how to install python cx_oracle module on a AIX/Unix host.
Lets have a look at the steps.
1. First download the module here
https://pypi.org/project/cx-Oracle/#files
It’s the bottom .tar.gz file.
2. Install the downloaded file and XLC Package.
## To install it, gunzip, untar and run: # python setup.py build install
However, this script needs xlc installed, so make sure XLC is installed.
And then then update /etc/vac.cfg at the bottom with:
options = -D_AIX,-D_AIX32,-D_AIX41,-D_AIX43,-D_AIX50,-D_AIX51,-D_AIX52,-D_AIX53,-D_AIX71,-D_IBMR2,-D_POWER oslevel = 7.1 os_variant = aix os_major = 7 os_minor = 1 Make entries to match your OS level. Also add /usr/vac/bin to your PATH temporarily.
3. Update Python Config
Update the file /opt/lib/python2.7/_sysconfigdata.py with below text: 'LDSHARED': '/opt/lib/python2.7/config/ld_so_aix xlc_r -bI:Modules/python.exp'
4. Set mode to 64 bit.
Set below environment variable in your profile.
OBJECT_MODE=64
5. Install the package
Run:
python setup.py build install
This will install the package as /opt/lib/python2.7/site-packages/cx_Oracle-7.3.0-py2.7-aix-7.1.egg
6. Add read permissions
chmod o+r /opt/lib/python2.7/site-packages/cx_Oracle-7.3.0-py2.7-aix-7.1.egg chmod o+r /opt/lib/python2.7/_sysconfigdata.py
7. Add below in user’s .profile.
export PYTHONPATH=${PYTHONPATH}:/opt/lib/python2.7/site-packages/cx_Oracle-7.3.0-py2.7-aix-7.1.egg