AIX

 View Only
Expand all | Collapse all

multiple python versions in AIX 7.3 TL2 SP1 and single python version in AIX 72 TL5 SP7

  • 1.  multiple python versions in AIX 7.3 TL2 SP1 and single python version in AIX 72 TL5 SP7

    Posted 21 days ago

    HI Team,

    We have observed few differences in Python versions and libraries. Our application has a dependency on Python, as AIX versions of 7.3 and 7.2 has different kind of Python versions, we were seeing few issues.

    with AIX 7.3 TL2 SP1:

    ===============

        2 python versions:   
            i) /opt/freeware/bin -> 3.9.16
            ii) /usr/bin  -> 3.9.17

    Initially we were installing Ansible. Usually ansible installs Python as well as it is already installed it ignores the python installation. However we require boto3 and try to import the boto3 with the path /opt/freeware/bin/python3 it failed with following error

     # /opt/freeware/bin/python3.9
    Python 3.9.16 (main, Jun 28 2023, 12:45:03)
    [GCC 8.3.0] on aix
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import boto3
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/opt/freeware/lib/python3.9/site-packages/boto3/__init__.py", line 16, in <module>
        from boto3.session import Session
      File "/opt/freeware/lib/python3.9/site-packages/boto3/session.py", line 17, in <module>
        import botocore.session
      File "/opt/freeware/lib/python3.9/site-packages/botocore/session.py", line 29, in <module>
        import botocore.credentials
      File "/opt/freeware/lib/python3.9/site-packages/botocore/credentials.py", line 34, in <module>
        from botocore.config import Config
      File "/opt/freeware/lib/python3.9/site-packages/botocore/config.py", line 16, in <module>
        from botocore.endpoint import DEFAULT_TIMEOUT, MAX_POOL_CONNECTIONS
      File "/opt/freeware/lib/python3.9/site-packages/botocore/endpoint.py", line 22, in <module>
        from botocore.awsrequest import create_request_object
      File "/opt/freeware/lib/python3.9/site-packages/botocore/awsrequest.py", line 25, in <module>
        import botocore.utils
      File "/opt/freeware/lib/python3.9/site-packages/botocore/utils.py", line 31, in <module>
        import botocore.httpsession
      File "/opt/freeware/lib/python3.9/site-packages/botocore/httpsession.py", line 8, in <module>
        from urllib3.util.ssl_ import (
    ImportError: cannot import name 'ssl' from 'urllib3.util.ssl_' (/opt/freeware/lib/python3.9/site-packages/urllib3/util/ssl_.py)

    how ever same got succeeded if we use /usr/bin, there is no problem with /usr/bin. so we wanted to continue with this version in AiX 7.3

    Coming AIX 7.2:

    ===============
      we only have one Python version which is 
        i) /opt/freeware/bin ->  3.9.16
    which is having issues with boto3, same errors pasted in above.

    what is the recommended way to install the boto3 packages here for AIX 7.2



    ------------------------------
    Vijay Yalamuri
    ------------------------------


  • 2.  RE: multiple python versions in AIX 7.3 TL2 SP1 and single python version in AIX 72 TL5 SP7

    Posted 20 days ago

    Vijay,

    First, I would suggest that you update your python3 installation on your AIX partition to the latest level. Given that you have it installed on your AIX 7.2 system under /opt/freeware/bin, it will likely was installed via rpm or dnf.

     In my case I updated my python3 version to the latest using dnf:

    # dnf update python3
    Last metadata expiration check: 0:00:18 ago on Wed May 29 06:52:00 CDT 2024.
    Dependencies resolved.
    =====================================================================================================================================================
     Package                             Architecture                  Version                               Repository                             Size
    =====================================================================================================================================================
    Upgrading:
     libffi                              ppc                           3.4.4-2                               AIX_Toolbox                            73 k
     python3                             ppc                           3.9.19-1                              AIX_Toolbox                           8.9 k
     python3.9                           ppc                           3.9.19-1                              AIX_Toolbox                            40 M
    
    Transaction Summary
    =====================================================================================================================================================
    Upgrade  3 Packages
    
    Total download size: 40 M
    Is this ok [y/N]: y
    

    I then ensure that pip3 was installed (in my case I had to install it):

    # dnf install python3.9-pip 
    Last metadata expiration check: 0:11:16 ago on Wed May 29 06:52:00 CDT 2024.
    Dependencies resolved.
    =====================================================================================================================================================
     Package                              Architecture                  Version                          Repository                                 Size
    =====================================================================================================================================================
    Installing:
     python3.9-pip                        noarch                        23.3.1-1                         AIX_Toolbox_noarch                        3.6 M
    
    Transaction Summary
    =====================================================================================================================================================
    Install  1 Package
    
    Total download size: 3.6 M
    Installed size: 11 M
    Is this ok [y/N]: y
    Downloading Packages:
    python3.9-pip-23.3.1-1.aix7.1.noarch.rpm                                                                             5.5 MB/s | 3.6 MB     00:00    
    

    Finally, I installed the boto3 module using the pip module I had just installed:

    # python3 -m pip install boto3
    Collecting boto3
      Downloading boto3-1.34.114-py3-none-any.whl.metadata (6.6 kB)
    Collecting botocore<1.35.0,>=1.34.114 (from boto3)
      Downloading botocore-1.34.114-py3-none-any.whl.metadata (5.7 kB)
    Collecting jmespath<2.0.0,>=0.7.1 (from boto3)
      Downloading jmespath-1.0.1-py3-none-any.whl.metadata (7.6 kB)
    Collecting s3transfer<0.11.0,>=0.10.0 (from boto3)
      Downloading s3transfer-0.10.1-py3-none-any.whl.metadata (1.7 kB)
    Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.35.0,>=1.34.114->boto3)
      Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
    Collecting urllib3<1.27,>=1.25.4 (from botocore<1.35.0,>=1.34.114->boto3)
      Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB)
         ---------------------------------------- 48.9/48.9 kB 325.3 kB/s eta 0:00:00
    Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore<1.35.0,>=1.34.114->boto3)
      Downloading six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
    Downloading boto3-1.34.114-py3-none-any.whl (139 kB)
       ---------------------------------------- 139.3/139.3 kB 967.5 kB/s eta 0:00:00
    Downloading botocore-1.34.114-py3-none-any.whl (12.3 MB)
       ---------------------------------------- 12.3/12.3 MB 6.5 MB/s eta 0:00:00
    Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)
    Downloading s3transfer-0.10.1-py3-none-any.whl (82 kB)
       ---------------------------------------- 82.2/82.2 kB 821.9 kB/s eta 0:00:00
    Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
       ---------------------------------------- 229.9/229.9 kB 1.6 MB/s eta 0:00:00
    Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB)
       ---------------------------------------- 143.8/143.8 kB 1.5 MB/s eta 0:00:00
    Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
    Installing collected packages: urllib3, six, jmespath, python-dateutil, botocore, s3transfer, boto3
    Successfully installed boto3-1.34.114 botocore-1.34.114 jmespath-1.0.1 python-dateutil-2.9.0.post0 s3transfer-0.10.1 six-1.16.0 urllib3-1.26.18
    

    I last checked the version of boto3 that was installed above:

    # python3 -m pip show boto3
    Name: boto3
    Version: 1.34.114
    Summary: The AWS SDK for Python
    Home-page: https://github.com/boto/boto3
    Author: Amazon Web Services
    Author-email: 
    License: Apache License 2.0
    Location: /opt/freeware/lib/python3.9/site-packages
    Requires: botocore, jmespath, s3transfer
    Required-by: 
    


    ------------------------------
    Abraham Alvarez
    ------------------------------