#!/usr/bin/python returns errors

4 views
Skip to first unread message

Kacper Krupa

unread,
Feb 11, 2009, 1:11:14 PM2/11/09
to web2py Web Framework
Hello,

#!/usr/bin/python returns errors on my mac. I had to change it to #!/
usr/bin/env python. I think you shoud replace it.

Thanks.

Wes James

unread,
Feb 11, 2009, 1:45:32 PM2/11/09
to web...@googlegroups.com
if you do

which python

at the command line what do you get?

How it is now has always worked on my macs.

Do you have something weird set in your .bashrc?

Time for archive and install?

Timothy Farrell

unread,
Feb 11, 2009, 1:49:24 PM2/11/09
to web...@googlegroups.com
#!/usr/bin/env python should be the normal setting for *nix
environments. The idea is that running env sets the appropriate path
for which to find the latest version of "python" If that line doesn't
work, then you should fix the environment path, not the first line in
your scripts.
--
Timothy Farrell <tfar...@swgen.com>
Computer Guy
Statewide General Insurance Agency (www.swgen.com)

Kacper Krupa

unread,
Feb 11, 2009, 1:51:49 PM2/11/09
to web2py Web Framework
It's 'cos i have another python on /usr/lib/python. When i've added #!/
usr/bin/env python it choose python from PYTHONPATH.

On 11 Lut, 19:45, Wes James <compte...@gmail.com> wrote:
> if you do
>
> which python
>
> at the command line what do you get?
>
> How it is now has always worked on my macs.
>
> Do you have something weird set in your .bashrc?
>
> Time for archive and install?
>

Kacper Krupa

unread,
Feb 11, 2009, 1:55:43 PM2/11/09
to web2py Web Framework
I've created symbolic link. It works but using /usr/bin/env python is
better i think.

mdipierro

unread,
Feb 11, 2009, 2:39:04 PM2/11/09
to web2py Web Framework
Those lines were put there by PythonTidy so I assume we should not
change them. What does pep8 say?

Timothy Farrell

unread,
Feb 11, 2009, 2:49:42 PM2/11/09
to web...@googlegroups.com

Timothy Farrell

unread,
Feb 11, 2009, 2:53:35 PM2/11/09
to web...@googlegroups.com
I suppose I could be a little more helpful. PEP 8 says nothing WRT
this. Wikipedia seems to suggest using '/usr/bin/env python' is a good
idea.

http://en.wikipedia.org/wiki/Shebang_(Unix)

Wes James

unread,
Feb 11, 2009, 3:05:23 PM2/11/09
to web...@googlegroups.com
On Wed, Feb 11, 2009 at 12:49 PM, Timothy Farrell <tfar...@swgen.com> wrote:
>
> http://letmegooglethatforyou.com/?q=pep+8


Interesting. It reminds me of the web sites out there these days that
look like a legitimate spyware scanner, but if you simply go to these
pages your system gets malware/trojans installed (windows/internet
exploder)

-wj

Reply all
Reply to author
Forward
0 new messages