python - ': [Errno 2] No such file or directoryile ' in Linux

标签 python linux apache

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

最佳答案

尝试给予脚本适当的权限

chmod +x dispatch.cgi

并确保您的 python 路径正确

which python2.7

关于python - ': [Errno 2] No such file or directoryile ' in Linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17721487/

相关文章:

python - 为什么我的递归函数返回 None?

python - argparse 命令行 - 给定路径后的选项

python - Spark : Generate Map Word to List of Similar Words - Need Better Performance

python - 导入torch(pytorch)时发生错误

c - 无限循环在 pthread 中终止

apache - Wamp SSL 配置抛出 404

linux - Linux 上的 Zigbee 堆栈(主线内核)?

linux - 如何将环境变量传递给 Ubuntu 上的 Netbeans Makefile?

apache - 使用 apache solr 去除口音

apache - open ssl需要提供完整的证书链