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

Python Upgrade on AIX

  • 1.  Python Upgrade on AIX

    Posted Fri February 21, 2020 10:50 PM

    Originally posted by: v1rotate


    My first attempt at asking question here :)

    AIX 7.1 running very limited number of packages - essentially whatever is bare minimum required to run python v2.7.15 (Yes, it is old and the purpose of the effort is to upgrade to v3)

    Python v2.7.15 was installed with rpm tool with the exception of openssl, via installp.

    In order to try to have python v2 coexist, taking the path of utilizing yum package management tool.

    However in order to get yum installed and working, we decided not to downgrade Python to v2.7.10 and leave Python at v2.7.15 as we installed the tar bundled package for yum to be used.

     

    It seems like yum is having issues when invoked as follows:

    bash-3.00# yum
    bash: /usr/bin/yum: /opt/freeware/bin/python2: bad interpreter: No such file or directory
     

    Most of the information is below. One issue could be that yum may be looking for python v2.7.10 but I dont want to downgrade.

     

    Also, python is:  which python
    /usr/bin/python

     

    I thought updating /usr/bin/yum by pointing to a working python version may work. so I updated the line from #!/opt/freeware/bin/python2 to #!/usr/bin/python and re ran yum help command and then got the following error:

     

    bash-3.00# yum help
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:

       No module named yum

    Please install a package which provides this module, or
    verify that the module is installed correctly.

    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.7.15 (default, May  7 2018, 16:04:01) [C]

    If you cannot solve this problem yourself, please go to
    the yum faq at:
      http://yum.baseurl.org/wiki/Faq

     

    Some additional information:

    bash-3.00# ldd /usr/bin/python
    /usr/bin/python needs:
             /usr/lib/libc.a(shr_64.o)
             /usr/lib/libpthreads.a(shr_xpg5_64.o)
             /usr/lib/libdl.a(shr_64.o)
             /unix
             /usr/lib/libcrypt.a(shr_64.o)

    bash-3.00# rpm -qf `which yum`
    yum-3.4.3-7.noarch
     

    bash-3.00# env
    AUTHSTATE=compat
    WSM_WS_CMD="startsrc -s http4websm"
    TERM=xterm
    SHELL=/usr/bin/ksh
    SSH_CLIENT=172.X.X.X 56374 22
    OLDPWD=/usr/bin
    WSM_DOC_DIR="/usr/websm/http/com.ibm.websm.http.server_1.0.0"
    SSH_TTY=/dev/pts/0
    LOCPATH=/usr/lib/nls/loc
    USER=root
    ODMDIR=/etc/objrepos
    SUDO_USER=whoareyou
    SUDO_UID=227
    RES_RETRY=1
    A__z=! LOGNAME
    MAIL=/usr/spool/mail/fe99tbd
    PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/whoareyou/bin:/usr/bin/X11:/sbin:.
    LOGIN=root
    PWD=/opt/freeware/bin
    LANG=C
    TZ=EST5EDT
    WSM_CGI_DIR=
    SHLVL=1
    HOME=/home/whoareyou
    SUDO_COMMAND=/usr/bin/su
    LC__FASTMSG=true
    MAILMSG=[YOU HAVE NEW MAIL]
    LOGNAME=root
    SSH_CONNECTION=172.X.X.X 56374 172.X.X.X 22
    DISPLAY=localhost:12.0
    RES_TIMEOUT=1
    SUDO_GID=1
    EXTENDED_HISTORY=ON
    _=/usr/bin/env
     

    bash-3.00# rpm -Va
    SM5....T.    /opt/freeware/lib/libintl.a
    ....L....    /usr/share/locale
    Unsatisfied dependencies for python-pycurl-7.19.5-1.noarch:
            libcurl >= 7.28.0 is needed by (installed) python-pycurl-7.19.5-1.noarch
            libcrypto.so is needed by (installed) python-pycurl-7.19.5-1.noarch
            libssl.so is needed by (installed) python-pycurl-7.19.5-1.noarch
    S.5....T.    /opt/freeware/lib/libsqlite3.so
    SM5....T.    /opt/freeware/lib/libz.a
    Unsatisfied dependencies for yum-3.4.3-7.noarch:
            python >= 2.7 is needed by (installed) yum-3.4.3-7.noarch
            /opt/freeware/bin/python2 is needed by (installed) yum-3.4.3-7.noarch
    S.5....T.    /opt/freeware/bin/yum
    S.5....T.  c /opt/freeware/etc/yum/yum.conf
    Unsatisfied dependencies for python-tools-2.7.10-1.ppc:
            python = 2.7.10 is needed by (installed) python-tools-2.7.10-1.ppc
            /opt/freeware/bin/python is needed by (installed) python-tools-2.7.10-1.ppc
            /opt/freeware/bin/python2.7 is needed by (installed) python-tools-2.7.10-1.ppc
            /opt/freeware/bin/python2.7_64 is needed by (installed) python-tools-2.7.10-1.ppc
            /usr/bin/python is needed by (installed) python-tools-2.7.10-1.ppc
    Unsatisfied dependencies for python-devel-2.7.10-1.ppc:
            python = 2.7.10 is needed by (installed) python-devel-2.7.10-1.ppc
    S.5....T.    /opt/freeware/bin/bunzip2
    S.5....T.    /opt/freeware/bin/bzcat
    S.5....T.    /opt/freeware/bin/bzip2
    S.5....T.    /opt/freeware/bin/bzip2recover
    SM5....T.    /opt/freeware/lib/libbz2.a
    SM5....T.    /opt/freeware/lib/libdb-4.8.a
    S.5....T.    /opt/freeware/lib/libdb-4.8.so
    ....L....    /opt/freeware/lib/libdb-4.a
    ....L....    /opt/freeware/lib/libdb-4.so
    ....L....    /opt/freeware/lib/libdb.a
    ....L....    /opt/freeware/lib/libdb.so
    ....L....    /opt/freeware/lib/libdb4.a
    S.5....T.    /opt/freeware/bin/install-info
    Unsatisfied dependencies for python-PyYAML-3.11-2.ppc:
            libyaml.a(libyaml-0.so.2) is needed by (installed) python-PyYAML-3.11-2.ppc
    SM5....T.    /opt/freeware/lib/libhistory.a
    SM5....T.    /opt/freeware/lib/libreadline.a
    S.5....T.    /etc/sudoers
    Unsatisfied dependencies for python-urlgrabber-3.10.1-1.noarch:
            python >= 2.7 is needed by (installed) python-urlgrabber-3.10.1-1.noarch
            /opt/freeware/bin/python is needed by (installed) python-urlgrabber-3.10.1-1.noarch
    Unsatisfied dependencies for python-iniparse-0.4-1.noarch:
            python >= 2.7 is needed by (installed) python-iniparse-0.4-1.noarch
    Unsatisfied dependencies for pysqlite-1.1.7-2.ppc:
            python >= 2.7 is needed by (installed) pysqlite-1.1.7-2.ppc
    I just want to get yum package working so I can start using yum to install Python 3 and all of its dependency.

     



  • 2.  Re: Python Upgrade on AIX

    Posted Mon February 24, 2020 03:59 AM

    Originally posted by: sangameshm


    Hi Failsal,

     

    The main issue here is that the main python-2 rpm package is missing which is required to run yum.

    If we install python packages then it's binaries will be installed in /opt/freeware/bin and the symbolic links in /usr/bin

    Running "rpm -qf /usr/bin/ython" or "lslpp -w /usr/bin/python" would give some idea about from where /usr/bin/python is coming.

    I doubt /usr/bin/python is coming from an rpm package.

     

    Here i am listing the comparison of yum bundle packages against those installed in your machines.

     

    ca-certificates-2016.10.7-2.aix6.1.ppc.rpm - same version as yum bundle
    curl-7.52.1-1.aix6.1.ppc.rpm - same version as yum bundle
    db-4.8.24-3.aix6.1.ppc.rpm - Higher version than yum bundle (db-4.8.24-4.ppc). Only release version difference. Looks like this not from the AIX Toolbox.
    gdbm-1.8.3-5.aix5.2.ppc.rpm - Higher version than yum bundle (gdbm-1.12-1.ppc)
    gettext-0.19.7-1.aix6.1.ppc.rpm - Higher version than yum bundle (gettext-0.19.8.1-1.ppc)
    glib2-2.14.6-2.aix5.2.ppc.rpm - Lower version than yum bundle (glib2-2.12.4-2.ppc)
    pysqlite-1.1.7-2.aix6.1.ppc.rpm - same version as yum bundle
    python-2.7.10-1.aix6.1.ppc.rpm - Missing
    python-devel-2.7.10-1.aix6.1.ppc.rpm - same version as yum bundle
    python-iniparse-0.4-1.aix6.1.noarch.rpm - same version as yum bundle
    python-pycurl-7.19.3-1.aix6.1.ppc.rpm - Higher version than yum bundle (python-pycurl-7.19.5-1.noarch). Looks like this not from the AIX Toolbox.
    python-tools-2.7.10-1.aix6.1.ppc.rpm - same version as yum bundle
    python-urlgrabber-3.10.1-1.aix6.1.noarch.rpm - same version as yum bundle
    readline-6.1-2.aix6.1.ppc.rpm - Higher version than yum bundle (readline-6.3-1.ppc)
    sqlite-3.15.2-1.aix6.1.ppc.rpm - Lower version than yum bundle (sqlite-3.7.15.2-3.ppc)
    yum-3.4.3-7.aix6.1.noarch.rpm - same version as yum bundle
    yum-metadata-parser-1.1.4-2.aix6.1.ppc.rpm - same version as yum bundle

     

    There are some packages which are at the lowest level and main python is missing.

    Please install python and update the lowest level packages to the version present in yum bundle.

    I see some of the higher versioned packages aren't from the AIX Toolbox. These may create issues if we have a incompatible version installed.

     

    Also, please run "updtvpkg" command to resolve the libcrypto & libssl errors.

     

    Thanks,

    Sangamesh