Running a python script under Linux
steve+comp.lang.python at pearwood.info
Fri Dec 14 03:45:18 CET 2012
I understand this is not exactly a Python question, but it may be of
interest to other Python programmers, so I'm asking it here instead of a
more generic Linux group.
I have a Centos system which uses Python 2.4 as the system Python, so I
set an alias for my personal use:
[steve at ando ~]$ which python
When I call "python some_script.py" from the command line, it runs under
Python 2.7 as I expected. So I give the script a hash-bang line:
and run the script directly, but instead of getting Python 2.7, it runs
under Python 2.4 and gives me system errors.
When I run env directly, it ignores my alias:
steve at ando ~]$ /usr/bin/env python -V
What am I doing wrong?
More information about the Python-list