I was working on the project that I had to use Python version 2.7.11 dues to a strict customer requirement. I just became a part of another project that I have to use Python 2.7.16, again strict customer requirement.
I originally installed my 2.7.11 in C:\Python27\ on my Windows machine. With understanding that installing multiple version of Python is possible, I installed 2.7.16 in C:\Python2.7.16\ on the same machine. I selected an option not to add this new python installation to PATH.
When I opened the command window and typed python.exe, python returned below output.
C:\>python
Python 2.7.16 (v2.7.16:413a49145e, Mar 4 2019, 01:30:55) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Thinking somehow the PATH got added, I checked the PATH variable, but it does not show the new path.
I tried to find out what is really running, but it was the installation of my old python, 2.7.11.
C:\>python
Python 2.7.16 (v2.7.16:413a49145e, Mar 4 2019, 01:30:55) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'C:\\Python27\\python.exe'
>>>
I also tried to run my old python specifically, but the result was the same.
C:\>C:\Python27\python.exe
Python 2.7.16 (v2.7.16:413a49145e, Mar 4 2019, 01:30:55) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
If I run the new installation, it looks like it correctly runs the 7.2.16 as below.
C:\>C:\Python2.7.16\python.exe
Python 2.7.16 (v2.7.16:413a49145e, Mar 4 2019, 01:30:55) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'C:\\Python2.7.16\\python.exe'
>>>
What is happening here? What version of Python am I running when I run the command "C:\Python27\python.exe"?
Did I change the version of Python installed in "C:\Python27\"? If not, why does the execution of python display the wrong version?