Which python??

Brandon Allbery allbery.b at gmail.com
Sun Oct 20 19:09:57 PDT 2013


On Sun, Oct 20, 2013 at 9:48 PM, Bruce Johnson <bruce.desertrat at gmail.com>wrote:

> On Oct 19, 2013, at 6:02 PM, Lawrence Velázquez <larryv at macports.org>
> wrote:
> > Have you run "hash -r" or started a new shell to make sure that your
> command path cache isn't stale?
>
> That appears to have been the issue, if I started a new terminal window,
> it came up correctly. In the terminal window I did the 'port install' in if
> I ran 'python' it came up in a 2.72 interpreter, in the new window it came
> up in 3.3.
>
> Weird, I've never run into this little quirk before.


You will only encounter it if you run an executable, then install another
executable with the same name in a directory earlier in your $PATH than the
one you had run. `hash -r` or changing $PATH (even to itself) will throw
away the shell's hash table and the new one will then be found.

Also, don't use `which` to check this; use `type`. Depending on the shell,
`which` may or may not use the shell's own information about where it has
found or will find a given executable. `type` is a POSIX specified shell
builtin that shows what the current shell knows, as opposed to what a new
shell will see or what it thinks a new shell would see.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20131020/19f99add/attachment.html>


More information about the macports-users mailing list