Hi Team,
We have upgraded the python version from python3.9.18 to python3.12.4 using the below steps.
login as root user
- yum update
- Go to /usr/src folder
- Download wget
https://www.python.org/ftp/python/3.12.3/Python-3.12.3.tgz - Unarchive tar -xf Python-3.12.3.tgz
- Install Dependencies using the command : sudo yum install -y gcc openssl-devel bzip2-devel libffi-devel zlib-devel readline-devel sqlite-devel
- cd Python-3.12.3
- ./configure --enable-optimizations
- sudo make install
- sudo ln -sf /usr/local/bin/python3.12 /usr/bin/python
- sudo ln -sf /usr/local/bin/python3.12 /usr/bin/python3
Upon executing this steps. Cloud-init is failing with some module error. PFB Logs.
cloud-init[18187]: ^^^^^^^^^^^^^^^^^^^^^^^
cloud-init[18187]: File “/usr/lib64/python3.12/importlib/metadata/init.py”, line 861,>
cloud-init[18187]: return Distribution.from_name(distribution_name)
cloud-init[18187]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cloud-init[18187]: File “/usr/lib64/python3.12/importlib/metadata/init.py”, line 399,>
cloud-init[18187]: raise PackageNotFoundError(name)
cloud-init[18187]: importlib.metadata.PackageNotFoundError: No package metadata was found f>
systemd[1]: cloud-init.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: cloud-init.service: Failed with result ‘exit-code’.
systemd[1]: Failed to start Initial cloud-init job (metadata service crawler)
Thank you in Advance