Building 4.27.2 on Centos 7 with Python 2.7

We need to compile Unreal 4.27.2 for Centos 7, but with Python 2.7 instead of the standard Python 3. I’ve got a Centos system set up, with the 4.27.2 source downloaded, and have successfully compiled and run it with the standard Python 3, mainly from these helpful notes, via:
./Setup.sh
./GenerateProjectFiles.sh
make

I’m looking for a way to instead compile with Python 2.7. I’ve seen reference to setting a UE_PYTHON_DIR environment variable, but it is unclear where I might point this at on Linux. Would it be the stock Python 2.7 on the box? There’s also a “libpython2.7.so.1.0” in Engine/Binaries/ThirdParty/Python/Linux/lib, but pointing at that dir didn’t seem to work.

Or would I need to modify a build configuration file somewhere before invoking “make”? Any real-world examples would be greatly appreciated.