kazarus 2009-06-25 09:54
浏览 326
已采纳

新手配置安装Mod_Python 出错,求指教

Mod_Ptyhon:mod_python-3.3.1.win32-py2.5-Apache2.2

python :2.5.4

import mod_python.apache 时报错
:no module named _apache ?

有遇到类似问题的兄弟吗?
[b]问题补充:[/b]
己知Mod_Python:http://www.modpython.org/FAQ/faqw.py?req=show&file=faq02.002.htp

全英文,有点不知所云.

懂英文的兄弟能大致解释一下好吗?
[b]问题补充:[/b]
谢谢laitaogood的翻译

MOD_PYTHON ERROR

ProcessId: 3348
Interpreter: 'lazarus.com'

ServerName: 'lazarus.com'
DocumentRoot: 'D:/AppServ/www'

URI: '/test/mptest.py'
Location: None
Directory: 'D:/AppServ/www/test/'
Filename: 'D:/AppServ/www/test/mptest.py'
PathInfo: ''

Phase: 'PythonHandler'
Handler: 'mptest'

Traceback (most recent call last):

File "D:\Python25\Lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)

File "D:\Python25\Lib\site-packages\mod_python\importer.py", line 1206, in _process_target
object = apache.resolve_object(module, object_str, arg, silent=silent)

File "D:\Python25\Lib\site-packages\mod_python\apache.py", line 696, in resolve_object
raise AttributeError, s

AttributeError: module 'D:\AppServ\www\test\mptest.py' contains no 'handler'

MODULE CACHE DETAILS

Accessed: Fri Jun 26 12:05:15 2009
Generation: 1

_mp_5e9aa0c2790cb0de6f82b4f385eb777b {
FileName: 'D:\AppServ\www\test\mptest.py'
Instance: 1
Generation: 1
Modified: Fri Jun 26 11:56:43 2009
Imported: Fri Jun 26 12:05:13 2009
}

  • 写回答

2条回答 默认 最新

  • laitaogood 2009-06-26 11:53
    关注

    [quote]The _apache module allows mod_python to get access to all the internal bits of apache. It is built in to the mod_python apache code and made available to python when mod_python is initialised. [/quote]
    _apache模块允许mod_python去访问apache的内部块。它构建了mod_python的apache代码并且使得mod_python初始化的时候对python可用。

    [quote]This means that you can't import mod_python into scripts that are run from the command line or any other context outside a running apache server.

    An exception to this is the _psp module. You can import this module, since it is just the interface to the flex-based C parser for psp. [/quote]
    这意味着你不能导入mod_python到那些从命令行运行的代码块或任何当前上下文外的正在运行的apache服务到代码块中。

    一个例外是_psp模块。你可以导入这个模块,它仅仅是psp的c解析器。

    我E文也不好哦,呵呵,凑合理解吧

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿