私のセットアップには、apache 2.2.17、mod_wsgi 3.3、python 2.7.2、trac 0.12.2、mercurial 1.8.4 が含まれます。2 つの問題が浮上しました。
- mercurial demandimport 初期化順序
- Mercurial がサイト パッケージの DLL を読み込めません。
次のように問題を解決しました。
- hgwebdir.wsgi を変更して demandimport を無効にします。
from mercurial import demandimport; demandimport.disable()
- 純粋な (.py のみ、コンパイル済みの .pyd なし) mercurial パッケージを作成してインストールします。https://www.mercurial-scm.org/wiki/WindowsInstallも参照してください。
E:\Dist\mercurial-1.8.4>setup.py --pure build
E:\Dist\mercurial-1.8.4>setup.py --pure install
コンパイルされたバージョン (Microsoft Visual Studio 2008 を使用) は、DLL のロードに失敗します。
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] mod_wsgi (pid=6092): Exception occurred processing WSGI script 'D:/Home/web/apache/cgi-bin/hgwebdir.wsgi'.
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] Traceback (most recent call last):
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "D:/Home/web/apache/cgi-bin/hgwebdir.wsgi", line 9, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] from mercurial.hgweb.hgwebdir_mod import hgwebdir
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\hgweb\\__init__.py", line 10, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] import hgweb_mod, hgwebdir_mod
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\hgweb\\hgweb_mod.py", line 10, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] from mercurial import ui, hg, hook, error, encoding, templater
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\ui.py", line 10, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] import config, util, error
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\config.py", line 9, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] import error, util
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\util.py", line 17, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] import error, osutil, encoding
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] ImportError: DLL load failed: The specified module could not be found.