The default OS python3 is the LPP version, don't change that, otherwise you'll end up running against modules installed to the wrong place.
Also, since cloud-init dumps it's modules on /opt/freeware, it needs to use that python (the optimal solution would be a cloud-init-specific venv, but I'm afraid that's even more work).
I'm checking cloud-init 22.1, and in /opt/freeware/bin/cloud-init, it specifies "#!/opt/freeware/bin/python3.9", so you shouldn't have a problem there.
I think the alternatives (to the python3.9 RPM) are:
- to rebuild the cloud-init RPM specifically for AIX 7.3, pointing at the /usr/opt/python3.9 or /usr/bin/python3.9
- to rebuild the cloud-init RPM , specifying "#!python3" (which will make it die every time someone sneezes near the PATH, and using a cloud-init VENV.
------------------------------
José Pina Coelho
IT Specialist at Kyndryl
------------------------------
Original Message:
Sent: Mon October 30, 2023 10:01 AM
From: Mackey Morgan
Subject: Will the real python3.9 please stand up?!
Hi Jose! I think I inadvertently combined two questions into one post. My primary question is regarding the ramifications of having two disparate python3.9 packages on my AIX servers--one as a LPP (python3.9.base) included with AIX 7.3.1.2 and the other installed as an RPM (python3.9-3.9.18-1.ppc) requisite for cloud-init. Since I have NOT included /opt/freeware/bin in my PATH at all, the ONLY python3 that will ever be called from the CLI would be the AIX native LPP:
# ls -l /usr/bin/python3
lrwxrwxrwx 1 root system 30 Oct 26 15:16 /usr/bin/python3 -> /usr/opt/python3/bin/python3.9
# ls -l /usr/opt/python3/bin/python3.9
-rwxr-xr-x 1 root system 222119 Jun 21 05:33 /usr/opt/python3/bin/python3.9
# ls -l /opt/freeware/bin/python3.9
-rwxr-xr-x 1 root system 189332 Sep 19 03:00 /opt/freeware/bin/python3.9
I suppose I could tack ":/opt/freeware/bin" to the end of my PATH, but so long as ":/usr/bin" has precedence in my PATH, it wouldn't change anything.
I think your response touched on another question that I have, namely whether there should also be a /usr/bin/python linked to /usr/opt/python3/bin/python3.9, as well as /usr/bin/python3. I think you have answered that question for me (i.e. "python", which is python2, is "deprecated" or "disallowed" or "unsupported" from this AIX release forward.).
------------------------------
Mackey Morgan
Original Message:
Sent: Thu October 26, 2023 09:11 AM
From: José Pina Coelho
Subject: Will the real python3.9 please stand up?!
Given that python3 was expected to be incompatible with python2, the usage of "python" was deprecated leaving your scripts to specify "python2" or "python3".
On an AIX 7.3, if you type "python3" you get nothing ?
------------------------------
José Pina Coelho
IT Specialist at Kyndryl
Original Message:
Sent: Wed October 25, 2023 11:07 AM
From: Mackey Morgan
Subject: Will the real python3.9 please stand up?!
We currently have two main requirements for python on AIX: 1) cloud-init (for PowerVC deployments) and 2) Ansible automation. We are having a difficult time getting our Automation Team to specify exactly which version/libraries of python they require/support for Ansible automation. In the mean time, I have been testing cloud-init-22.1-5.noarch with it's own RPM requisite python3.9-3.9.18-1.ppc. Now python3.9 is also included with AIX 7.3.1.2 as a LPP: python3.9.base 3.9.12.0. (BTW, in our post customization, we update this package to 3.9.18, I believe) But neither seem to be configured as the AIX "default" for "python" in our default PATH, at all. AIX 7.3.1.2 seems to be configured by "default" to have "python3" point to the LPP package in our PATH. So is the "python" executable considered to be deprecated now? Is there any reason that I should have/maintain two different python3.9 packages in AIX 7.3.1.2?
------------------------------
Mackey Morgan
------------------------------