Willie Lopez added the comment:
Thank you anyway. I was able to finally resolve the issue, which did turn out
to be the environment variable PYTHONPATH. When compiling python from source,
that variable must be empty (not null). After emptying the string value the
compilation worked.
This
New submission from Willie Lopez :
When building Python-2.7.16 on CentOS-7.4, building with --enable-shared
through ./configure will cause Python to fail its build without errors and will
install python-2.7.5, the wrong version. If Python is built without
--enable-shared, other compilations