Search code examples
pythonlinuxwindowsterminalcommand-prompt

Run second or subsequent file located in path that match where pattern


By running where python in command prompt, I get the following files that match the python pattern located in my path:

C:\Program Files\Anaconda\python.exe
C:\Program Files\Anaconda\envs\python2.7\python.exe
C:\Users\User\AppData\Local\Microsoft\WindowsApps\python.exe

I want to access the second, third or subsequent Python in the list. How can I go about it without renaming any of the files? Running python in the command prompt will ordinarily get me the first one... Can I also get a Unix based solution too aside from just command-prompt?


Solution

  • I found that the precedence indicated by the where command is dependent on the ordering of directories in my system PATH. Reordering them may change their precedence.