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 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥15 用visual studi code完成html页面