AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
Expand all | Collapse all

How to install cx_Oracle on AIX?

  • 1.  How to install cx_Oracle on AIX?

    Posted Fri April 23, 2021 06:26 AM
    Hi,

    we are using YUM on our AIX 7.1 (TL5) systems an our database admins requestet to install python3 and cx_Oracle 8.1 on our systems. Pyhon3 seems to be fine, as it is provided via YUM, but I can't find cx_Oracle for AIX anywhere. There don't seems to be an AIX wheel (https://pypi.org/project/cx-Oracle/#files).

    Is anyone using cx_Oracle on AIX and could help me, get it working?

    ------------------------------
    Janko
    Leipzig, Germany
    ------------------------------


  • 2.  RE: How to install cx_Oracle on AIX?

    Posted Fri April 23, 2021 06:39 AM
    Edited by SANKET RATHI Fri April 23, 2021 06:40 AM
    You can install it using pip if you have internet connection.
    For that first you need to install gcc using yum.

    If there is no wheel then pip download the source and build it on fly (hence you need gcc).
    After installing gcc just run the following command. 

    # pip3 install cx_Oracle


    ------------------------------
    SANKET RATHI
    ------------------------------



  • 3.  RE: How to install cx_Oracle on AIX?

    Posted Fri April 23, 2021 07:28 AM
    Our servers don't have internet connection. Any chance to build it locally?

    ------------------------------
    Janko
    Leipzig, Germany
    ------------------------------



  • 4.  RE: How to install cx_Oracle on AIX?

    Posted Fri April 23, 2021 07:38 AM
    You can download and give the source tar file as input to pip command also.

    pip3 install cx_Oracle-8.1.0.tar.gz

    ------------------------------
    Ayappan P
    ------------------------------



  • 5.  RE: How to install cx_Oracle on AIX?

    Posted Wed April 28, 2021 02:36 AM
    I have a problem, getting pip3. All I found was "python-pip" (v 10.0.1) but this seems to be for python 2.7 only:
    root> pip -V
    pip 10.0.1 from /opt/freeware/lib/python2.7/site-packages/pip (python 2.7)​
    Where can I get "pip3"?

    ------------------------------
    Janko
    Germany
    ------------------------------



  • 6.  RE: How to install cx_Oracle on AIX?

    Posted Wed April 28, 2021 02:58 AM
    pip3 comes with python3 rpm.
    One has to invoke " python3 -m pip install ... " 
    We are not shipping pip3 as such in /opt/freeware/bin . But that is something which we will try to provide in the future.

    ------------------------------
    Ayappan P
    ------------------------------



  • 7.  RE: How to install cx_Oracle on AIX?
    Best Answer

    Posted Wed April 28, 2021 09:30 AM
    pip3 is equivalent to "python3 -m pip"
    So you can use command like following. 

    # python3 -m pip install cx_Oracle-8.1.0.tar.gz

    ------------------------------
    SANKET RATHI
    ------------------------------



  • 8.  RE: How to install cx_Oracle on AIX?

    Posted Thu April 29, 2021 01:12 AM
    Hi,

    That did it. I was able to install/build "cx_Oracle" with this locally.

    Thanks for all of your support!

    ------------------------------
    Janko
    Leipzig, Germany
    ------------------------------



  • 9.  RE: How to install cx_Oracle on AIX?

    Posted Mon April 26, 2021 02:48 AM
    Hi,

    cx_Oracle has a binary component which will not compile on AIX, because it has an OS dependent code. I was able to comment out that code and compile the module, so our customers are using it now on AIX in production.

    Greetings from Leipzig,
    P. Tanvoski

    ------------------------------
    Plamen Tanovski
    ------------------------------



  • 10.  RE: How to install cx_Oracle on AIX?

    Posted Mon April 26, 2021 03:00 AM
    Thank you Palmen, Can you please add more information about the binary component ? 
    Where is it and how to exclude ? This will help other community members who wants to use it on AIX.
    Between when I tried to install cx_Oracle on my AIX system it worked just fine.

    # pip3 install cx_Oracle-8.1.0.tar.gz
    Processing ./cx_Oracle-8.1.0.tar.gz
    Installing build dependencies ... done
    Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
    Building wheels for collected packages: cx-Oracle
    Building wheel for cx-Oracle (PEP 517) ... done
    Created wheel for cx-Oracle: filename=cx_Oracle-8.1.0-cp37-cp37m-aix_7_2.whl size=271944 sha256=04a6a5a93b4e59fa7dd93e9ccf1c6dbaf558c7a222292d2e6845f962eb835114
    Stored in directory: /.cache/pip/wheels/f3/70/83/610aadb38270d2ae7163bc5affd46fafb49504fc0c16c2c246
    Successfully built cx-Oracle
    Installing collected packages: cx-Oracle
    Successfully installed cx-Oracle-8.1.0
    WARNING: You are using pip version 20.1.1; however, version 21.0.1 is available.
    You should consider upgrading via the '/opt/freeware/bin/python3 -m pip install --upgrade pip' command.

    #

    ------------------------------
    SANKET RATHI
    ------------------------------



  • 11.  RE: How to install cx_Oracle on AIX?

    Posted Mon April 26, 2021 03:47 AM
    Hi,

    the binary module is cx_Oracle.so. You cannot compile it directly on AIX, because the source has a system call, which is not available on AIX.  It is dpiOci__loadLibInModuleDir() in cx_Oracle/odpi/src/dpiOci.c  which will not work. Commenting out this function helps compile the module:

    # ldd /opt/freeware/lib64/python3.7/site-packages/cx_Oracle-8.0.0.dev0-py3.7-aix-7.1.egg/cx_Oracle.so
    /opt/freeware/lib64/python3.7/site-packages/cx_Oracle-8.0.0.dev0-py3.7-aix-7.1.egg/cx_Oracle.so needs:
    /usr/lib/libpthreads.a(shr_xpg5_64.o)
    /usr/lib/libc.a(shr_64.o)
    /unix
    /usr/lib/libcrypt.a(shr_64.o)


    I can provide mine rpm package (and the source), but I don't want any legal trouble with IBM.

    Also cx_Oracle needs a proper LIBPATH env var to function.

    Best regards

    ------------------------------
    Plamen Tanovski
    ------------------------------