我正在尝试让 python cgi 脚本在 Apache 2.2 上运行。
我有reporting.cgi
cgi-bin 并且工作正常。
import sys
import os
import clr
import pypyodbc
import cgi.
# HTML Header
print '<html>'
print '<head>'
print '<link rel="stylesheet" href="../html_docs/epydoc.css" type="text/css" />'
print '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'
print '<title>Test Framework</title>'
print '</head>'
..
...
..
但是,我需要在网络驱动器上使用其他 Python 模块。(genutils.py)
所以我尝试导入位置并导入genutils.py。
sys.path.insert(0, 'I:/swd/Shared/Python')
import genutils
但是,现在当我尝试调用我的网页时,我得到了
[Mon Oct 07 14:02:25 2013] [error] [client 10.70.26.3] File "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/cgi-bin/reporting.cgi", line 23, in <module>\r\r
[Mon Oct 07 14:02:25 2013] [error] [client 10.70.26.3] ImportError: No module named genutils.
我也sys.path.append
没有使用驱动器号(//machine/dir/swd/shared/python
)
非常感谢任何建议。
谢谢。