Time to runThis is completely undocumented in the python 2.7.13 straceREADME I guessfile, but one can use LD_* tricks (or ELF-mangling applications, below) to see whyworkaround this deficiency of the python build is sucking so hardprocess. Also! If possible avoid building to the default of /usr/local as that will mix whatever version you're building into whatever might be in /usr/local; GNU stow or similar could be used if you do need a /usr/local/bin/python program but want the actual build sequestered off in, say, /usr/local/python-2.7.13:
-bash-4.2$ make distclean
...
-bash-4.2$ ./configure --enable-shared --with-ensurepip --prefix=/usr/local/python-2.7.13
-bash-4.2$ make && sudo make install
...
Ugh, the LD_RUN_PATH method requires two builds, and now the second (the first build installed 2.7.13 libpython2.7 libraries this next build picks up on and uses)...
-bash-4.2$ make distclean
...
-bash-4.2$ ./configure --enable-shared --with-ensurepip --prefix=/usr/local/python-2.7.13
...
-bash-4.2$ LD_RUN_PATH=/usr/local/python-2.7.13/lib make
...
-bash-4.2$ ldd ./python
linux-vdso.so.1 => (0x00007ffca7bcd000)
libpython2.7.so.1.0 => /usr/local/python-2.7.13/lib/libpython2.7.so.1.0 (0x00007fc6534fb000)
...
-bash-4.2$ sudo make install
...
-bash-4.2$ /usr/local/python-2.7.13/bin/python --version
Python 2.7.13
-bash-4.2$
With instead ELF-mangling tools, one of which is https://github.com/NixOS/patchelf which after being installed per the README file in that repository one can do a single python build and install:
-bash-4.2$ sudo rm -rf /usr/local/python-2.7.13
-bash-4.2$ ./configure --enable-shared --with-ensurepip --prefix=/usr/local/python-2.7.13
-bash-4.2$ make
-bash-4.2$ patchelf --set-rpath /usr/local/python-2.7.13/lib python
-bash-4.2$ sudo make install
-bash-4.2$ ldd /usr/local/python-2.7.13/bin/python
linux-vdso.so.1 => (0x00007ffeb57ac000)
libpython2.7.so.1.0 => /usr/local/python-2.7.13/lib/libpython2.7.so.1.0 (0x00007fcea6b75000)
...
-bash-4.2$ /usr/local/python-2.7.13/bin/python --version
Python 2.7.13
-bash-4.2$