【问题标题】:': [Errno 2] No such file or directoryile ' in Linux': [Errno 2] Linux 中没有这样的文件或目录
【发布时间】:2013-07-17 06:53:12
【问题描述】:
-bash-3.2$ dir    
dispatch.cgi  stats
-bash-3.2$ ./dispatch.cgi
': [Errno 2] No such file or directoryile '

这是dispatch.cgi

#!/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 没有被执行?

【问题讨论】:

    标签: python linux apache


    【解决方案1】:

    尝试给脚本适当的权限

    chmod +x dispatch.cgi
    

    并确保您的 python 路径正确

    which python2.7
    

    【讨论】:

    • 我已经完成了 chmod +x dispatch.cgi,但是如何使用 'which python2.7' 检查我的 python 路径?我的路径是 /usr/local/bin/python2.7 但是当我在任何文件中使用它时它说解释器错误
    • 'which python2.7' entered in your shell 显示了 python 二进制文件的完整路径。也许一些不正确的行尾(windows而不是linux)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-11-20
    • 2015-11-19
    • 2013-03-21
    • 2015-04-09
    • 2019-05-26
    • 2018-12-06
    • 1970-01-01
    相关资源
    最近更新 更多