psycopg2 和 mod_python 导入错误

发布于 2024-08-09 09:00:32 字数 2009 浏览 11 评论 0原文

我正在尝试在 Windows XP 计算机上设置 roundup 。 我使用 psycopg2 v2.0.13,当我从 shell 导入 psycopg2 模块时,一切正常,但是当 mod_python 尝试执行此操作时,我收到此错误:

MOD_PYTHON ERROR

ProcessId:      3464
Interpreter:    'roundup'

ServerName:     'roundup'
DocumentRoot:   'C:/Dev/roundup/tracker'

URI:            '/index.html/'
Location:       None
Directory:      'C:/Dev/roundup/tracker/'
Filename:       'C:/Dev/roundup/tracker/dummy.py'
PathInfo:       '/index.html/'

Phase:          'PythonHandler'
Handler:        'roundup.cgi.apache'

Traceback (most recent call last):

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

  File "C:\Python25\lib\site-packages\mod_python\importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "C:\Python25\lib\site-packages\mod_python\importer.py", line 1128, in _execute_target
    result = object(arg)

  File "C:\Python25\lib\site-packages\roundup\cgi\apache.py", line 107, in handler
    _tracker = roundup.instance.open(_home, optimize=0)

  File "C:\Python25\lib\site-packages\roundup\instance.py", line 300, in open
    return Tracker(tracker_home, optimize=optimize)

  File "C:\Python25\lib\site-packages\roundup\instance.py", line 59, in __init__
    self.backend = backends.get_backend(self.get_backend_name())

  File "C:\Python25\lib\site-packages\roundup\backends\__init__.py", line 46, in get_backend
    module = __import__(module_name, vars)

  File "C:\Python25\lib\site-packages\roundup\backends\back_postgresql.py", line 18, in <module>
    from psycopg2 import psycopg1 as psycopg

  File "C:\Python25\lib\site-packages\psycopg2\__init__.py", line 59, in <module>
    from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID

ImportError: DLL load failed: The specified module could not be found.

非常感谢帮助。

I am trying to setup roundup on a windows XP machine.
I use psycopg2 v2.0.13 and when i import the psycopg2 module from the shell it all works fine, but when mod_python tries to do it, I get this error:

MOD_PYTHON ERROR

ProcessId:      3464
Interpreter:    'roundup'

ServerName:     'roundup'
DocumentRoot:   'C:/Dev/roundup/tracker'

URI:            '/index.html/'
Location:       None
Directory:      'C:/Dev/roundup/tracker/'
Filename:       'C:/Dev/roundup/tracker/dummy.py'
PathInfo:       '/index.html/'

Phase:          'PythonHandler'
Handler:        'roundup.cgi.apache'

Traceback (most recent call last):

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

  File "C:\Python25\lib\site-packages\mod_python\importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "C:\Python25\lib\site-packages\mod_python\importer.py", line 1128, in _execute_target
    result = object(arg)

  File "C:\Python25\lib\site-packages\roundup\cgi\apache.py", line 107, in handler
    _tracker = roundup.instance.open(_home, optimize=0)

  File "C:\Python25\lib\site-packages\roundup\instance.py", line 300, in open
    return Tracker(tracker_home, optimize=optimize)

  File "C:\Python25\lib\site-packages\roundup\instance.py", line 59, in __init__
    self.backend = backends.get_backend(self.get_backend_name())

  File "C:\Python25\lib\site-packages\roundup\backends\__init__.py", line 46, in get_backend
    module = __import__(module_name, vars)

  File "C:\Python25\lib\site-packages\roundup\backends\back_postgresql.py", line 18, in <module>
    from psycopg2 import psycopg1 as psycopg

  File "C:\Python25\lib\site-packages\psycopg2\__init__.py", line 59, in <module>
    from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID

ImportError: DLL load failed: The specified module could not be found.

Help will be very appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故事和酒 2024-08-16 09:00:32

只需安装 Visual Studio Redist: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=766a6af7-ec73-40ff-b072-9112bab119c2

选择更适合您的系统的一个。

Just install the Visual Studio Redist: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=766a6af7-ec73-40ff-b072-9112bab119c2

Choose the one that conforms better to your system.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文