I've been having nightmares with this mistery for 3 days. Like I've done many times I downloaded the sources for Python (this time 2.7.13) to compile them in an environtment with no access to the internet (and therefore no other way to get newer versions of software). I'm in Oracle Linux 7.3 (RHEL like environment). By default this one brings python 2.7.5 with it but I need the newer version for some testings and to get pip OOTB.
I did the usual:
# ./configure --enable-shared --with-ensurepip # make # make install
Everything ran fine until I tried to install some extra package like requests with pip.
[root@oel7 python_pkgs]# pip install requests-2.11.1/ Traceback (most recent call last): File "/usr/local/bin/pip", line 7, in <module> from pip import main ImportError: No module named pip
Huh... Then I tried to check what python was actually installed in
[root@oel7 ~]# /usr/local/bin/python2.7 --version Python 2.7.5
So I tried to recompile everything BUT without installing the resulting binaries to see what was actually being made inside the sources directory.
[root@oel7 Python-2.7.13]# make distclean [root@oel7 Python-2.7.13]# ./configure --enable-shared --with-ensurepip [root@oel7 Python-2.7.13]# ... [root@oel7 Python-2.7.13]# make [root@oel7 Python-2.7.13]# ... [root@oel7 Python-2.7.13]# ./python --version Python 2.7.5
I don't have a clue of what to do now. Why does the resulting binary says its version is the one that's installed in the system by default? I also tried using another prefix without success.