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