I have an older Debian machine running Debian 10. This machine has installed Python 3.7.3
. I cannot upgrade this machine to a newer version, need to wait for the company to release an upgrade.
I upgraded my ansible
installation to the latest 2.18.1
and the old Python version on the target machine is now not supported anymore.
I compiled Python 3.12.8
and installed it using make altinstall
.
Additionally I set the variable ansible_python_interpreter
for this machine in the inventory accordingly:
ansible_python_interpreter: /usr/local/bin/python3.12
Other modules running fine, self installed Python version is used, output of ansible.builtin.setup
:
"ansible_python": {
"executable": "/usr/local/bin/python3.12",
"has_sslcontext": true,
"type": "cpython",
"version": {
"major": 3,
"micro": 8,
"minor": 12,
"releaselevel": "final",
"serial": 0
},
"version_info": [
3,
12,
8,
"final",
0
]
}
ansible.builtin.apt
indeed throws the following error:
"ansible-core requires a minimum of Python version 3.8. Current version: 3.7.3 (default, Nov 23 2024, 16:31:22) [GCC 8.3.0]"
I think it’s because of the missing python3-apt
module in my alternative Python installation.
How can I install python3-apt
into my self-compiled Python 3.12.8? I tried pip
, but this package is somehow not even existing.