2013-07-18 25 views
-3
-bash-3.2$ dir  
dispatch.cgi stats 
-bash-3.2$ ./dispatch.cgi 
': [Errno 2] No such file or directoryile ' 

这是dispatch.cgi':[错误2]没有这样的文件或directoryile' 在Linux中

#!/usr/local/bin/python2.7 
import sys, os 
sys.path += ['/home/content/88/10907688/lib/venv/lib/python2.7/site-packages'] 
sys.path += ['/home/content/88/10907688/lib/venv/bin/gccFishing'] 
os.environ['DJANGO_SETTINGS_MODULE'] = 'gccFishing.settings' 
from flup.server.fcgi import WSGIServer 
from django.core.handlers.wsgi import WSGIHandler 
WSGIServer(WSGIHandler()).run() 

为什么dispatch.cgi没有得到执行?

回答

1

尽量给脚本适当的权限

chmod +x dispatch.cgi 

,并确保您对Python的路径是正确的

which python2.7 
+0

我已经做了使用chmod + X dispatch.cgi,但我如何检查我的'哪个python2.7'的Python路径?我的路径是/usr/local/bin/python2.7,但是当我在任何文件中使用它时,它说不好的解释器 – Hammad

+0

'python2.7'在shell中输入时显示python二进制文件的完整路径。 也许一些不正确的行结尾(Windows而不是Linux) – deagh

相关问题