MacResource
How does the terminal know where python 3.6 is located? - Printable Version

+- MacResource (https://forums.macresource.com)
+-- Forum: My Category (https://forums.macresource.com/forumdisplay.php?fid=1)
+--- Forum: Tips and Deals (https://forums.macresource.com/forumdisplay.php?fid=3)
+--- Thread: How does the terminal know where python 3.6 is located? (/showthread.php?tid=210395)



How does the terminal know where python 3.6 is located? - freeradical - 11-04-2017

In usr/bin, I have python 2.7 (pre)installed.

I installed python 3.6, and when I'm in usr/bin, I can simply type python3.6 and it starts up even though the installer didn't put the program there. How is this possible?


Re: How does the terminal know where python 3.6 is located? - rz - 11-04-2017

When terminal starts, it reads a file (likely .bashrc) that has search paths. It will automatically search for programs in those locations.


Re: How does the terminal know where python 3.6 is located? - freeradical - 11-04-2017

Ah, so the installer probably wrote to that file.

Thanks


Re: How does the terminal know where python 3.6 is located? - JoeH - 11-05-2017

usr/bin was probably already defined as part of the search path to be used for commands. It is a fairly standard location for unix commands to be found.


Re: How does the terminal know where python 3.6 is located? - Racer X - 11-05-2017

I always know where MY python is Confusedmiley-shocked003:


Re: How does the terminal know where python 3.6 is located? - mattkime - 11-06-2017

`which python` will show you which version of python its finding.