advertisement
Forums

The Forum is sponsored by 
 

AAPL stock: Click Here

You are currently viewing the Tips and Deals forum
How does the terminal know where python 3.6 is located?
Posted by: freeradical
Date: November 04, 2017 05:21PM
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?
Options:  Reply • Quote
Re: How does the terminal know where python 3.6 is located?
Posted by: rz
Date: November 04, 2017 05:36PM
When terminal starts, it reads a file (likely .bashrc) that has search paths. It will automatically search for programs in those locations.
Options:  Reply • Quote
Re: How does the terminal know where python 3.6 is located?
Posted by: freeradical
Date: November 04, 2017 05:53PM
Ah, so the installer probably wrote to that file.

Thanks
Options:  Reply • Quote
Re: How does the terminal know where python 3.6 is located?
Posted by: JoeH
Date: November 04, 2017 08:55PM
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.
Options:  Reply • Quote
Re: How does the terminal know where python 3.6 is located?
Posted by: Racer X
Date: November 04, 2017 09:39PM
I always know where MY python is smiley-shocked003
Options:  Reply • Quote
Re: How does the terminal know where python 3.6 is located?
Posted by: mattkime
Date: November 05, 2017 07:40PM
`which python` will show you which version of python its finding.



Options:  Reply • Quote
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 145
Record Number of Users: 186 on February 20, 2020
Record Number of Guests: 2330 on October 25, 2018