#!/usr/bin/env python
means "go find python
on $PATH
as if it the shell were looking for it, and run that." So since you get different results, you are probably using different pythons.
To check, see if running /usr/local/bin/python
and /usr/bin/env python
give you the same pythons. You can also use type -a python
to find every python
on $PATH
. On my system, type -a python
gives:
python is /opt/local/bin/python
python is /usr/bin/python
python is /usr/local/bin/python
(That first one is installed by MacPorts.)
Anyway, as rodrigo points out, direct launching is probably not using the $PATH
you expect. Which means using /usr/bin/env
isn't going to work.