25
我想運行一個python腳本。當我運行它,它工作正常:添加一個shebang導致運行我的python腳本時沒有這樣的文件或目錄錯誤
python2.5 myscript.py inpt0
當我添加一個認領的問題開始:
#!/usr/bin/env python2.5
導致:
$ myscript.py inpt0
: No such file or directory
嘗試2:
#!/usr/local/bin/python2.5
結果於:
$ myscript.py inpt0
: bad interpreter: No such file or directoryon2.5
當我直接在終端上運行他們,他們都工作得很好:
$ /usr/local/bin/python2.5
Python 2.5.4 (r254:67916, Feb 9 2009, 12:50:32)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
$ /usr/bin/env python2.5
Python 2.5.4 (r254:67916, Feb 9 2009, 12:50:32)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
關於如何使家當這項工作任何提示?
啊謝謝。有一點dos2unix myscript.py做了詭計! – Pe2 2009-02-10 07:52:00