# Install ansible4.10.0 on custom python3.12.5 on redhat8

**URL:** <https://forum.ansible.com/t/install-ansible4-10-0-on-custom-python3-12-5-on-redhat8/8089>\
**Category:** Get Help\
**Tags:** install, redhat, python\
**Created:** [August 26, 2024, 11:46am UTC](https://forum.ansible.com/t/install-ansible4-10-0-on-custom-python3-12-5-on-redhat8/8089 "2024-08-26T11:46:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Okieh](https://avatars.discourse-cdn.com/v4/letter/o/8edcca/32.png) [@Okieh](https://forum.ansible.com/u/Okieh)\
**Post date:** [August 26, 2024, 11:46am UTC](https://forum.ansible.com/t/install-ansible4-10-0-on-custom-python3-12-5-on-redhat8/8089/1 "2024-08-26T11:46:04Z")

</div>

I did build a python3.12.5 underneath a custom location on a server without direct internet access. So i downloaded several modules and transferred them onto the server. But it complains about setuptools not being available, whereas python states them being fine (even recent version).

_$ python3 -m pip install --no-index --find-links=. ansible_  
_Looking in links: ._  
_Processing ./ansible-4.10.0.tar.gz_

- Preparing metadata (setup.py) … error\*

- error: subprocess-exited-with-error\*

- × python setup.py egg\_info did not run successfully.\*

- │ exit code: 1\*

- ╰─\> [1 lines of output]\*

- 

```
 ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.*

```

- 

```
 [end of output]*

```

- note: This error originates from a subprocess, and is likely not a problem with pip.\*  
_error: metadata-generation-failed_

_× Encountered error while generating package metadata._  
_╰─\> See above for output._

_note: This is an issue with the package mentioned above, not pip._  
_hint: See above for details._  
_$ python3 -m pip install --no-index --find-links=. setuptools_  
_Looking in links: ._  
_Requirement already satisfied: setuptools in /opt/SP/deploydata/tools/lib/python3.12/site-packages (59.6.0)_  
_$ which python3_  
_/opt/SP/deploydata/tools/bin/python3_  
_$ which python_  
_/opt/SP/deploydata/tools/bin/python_  
_$ python3 --version_  
_Python 3.12.5_  
_$ python --version_  
_Python 3.12.5_  
_$ cat /etc/redhat-release_  
_Red Hat Enterprise Linux release 8.10 (Ootpa)_

When i gunzip/untar the ansible-4.10.0.tar.gz and go into the ansible-4.10.0 directory, i receive following error instead:  
_$ python3 setup.py install_  
_Traceback (most recent call last):_

- File “/var/SP/data/tools/.build/Python-3.12.5/download/ansible-4.10.0/setup.py”, line 5, in \*
- from setuptools import setup\*
- File “/opt/SP/deploydata/tools/lib/python3.12/site-packages/setuptools/ **init**.py”, line 10, in \*
- import distutils.core\*  
_ModuleNotFoundError: No module named ‘distutils’_

Where distutils has been removed from the python distribution and should not been used at all.

Therefore i would appreciate all hints on how to get it up and running!  
Thanks for your support 🙂

PS: i am not in the position to exchange the servers OS level or connect to internet ☹

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [August 26, 2024, 12:32pm UTC](https://forum.ansible.com/t/install-ansible4-10-0-on-custom-python3-12-5-on-redhat8/8089/2 "2024-08-26T12:32:21Z")

</div>

Ansible 4 is very old. It was released 2 years before python3.12. Its likely that it does not support python3.12, for reasons like this:

> Where distutils has been removed from the python distribution and should not been used at all.

---

<div class="post-metadata">

**Author:** ![konstruktoid](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/konstruktoid/32/10207_2.png) [@konstruktoid](https://forum.ansible.com/u/konstruktoid)\
**Post date:** [August 26, 2024, 1:33pm UTC](https://forum.ansible.com/t/install-ansible4-10-0-on-custom-python3-12-5-on-redhat8/8089/3 "2024-08-26T13:33:28Z")

</div>

RHEL8 with its related Python and in turn Ansible is old.  
If you’re not in the position to exchange the servers OS level (I assume you can’t upgrade to RHEL9) or connect to internet, then my suggestion is that you use the latest possible version, even if it’s very old.

[Interpreter discovery broken for rhel 8 based distros on 2.17 · Issue #83357 · ansible/ansible (github.com)](https://github.com/ansible/ansible/issues/83357)  
[SyntaxError: future feature annotations is not defined · Issue #82068 · ansible/ansible (github.com)](https://github.com/ansible/ansible/issues/82068)
