4

I just downloaded a python script and noticed that the "shebang" line at the top looks like:

#!/usr/bin/env python

instead of the familiar

#!/usr/bin/python

What's the reason for that?

1 Answer 1

6

This is commonly used if the absolute path of the interpreter binary is not know or is assumed to be in different location from system to system. For python one could have an installation in /usr/local/ in addition to the ones installed by the distribution in /usr/. Without env in the shebang you would have to modify it to reflect your installation in /url/local/.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .