我在虚拟机上运行的 Win 2k8 R2 上安装了 Mercurial 1.8.1、Python 2.6.6。我试过从 msi、源和使用 tortisehg 安装。命令行 Hg 工作正常,但在运行 hgweb.cgi 时出现相同的错误:
Traceback (most recent call last): File ".\hgweb.cgi", line 17, in application = hgweb(config) File "mercurial\hgweb\__init__.pyc", line 26, in hgweb File "mercurial\hgweb\hgwebdir_mod.pyc", line 61, in __init__ File "mercurial\hgweb\hgwebdir_mod.pyc", line 70, in refresh File "mercurial\ui.pyc", line 35, in __init__ File "mercurial\demandimport.pyc", line 75, in __getattribute__ File "mercurial\demandimport.pyc", line 47, in _load File "mercurial\util.pyc", line 576, in File "mercurial\demandimport.pyc", line 85, in _demandimport File "mercurial\windows.pyc", line 21, in File "mercurial\demandimport.pyc", line 75, in __getattribute__ File "mercurial\demandimport.pyc", line 47, in _load File "mercurial\osutil.pyc", line 12, in File "mercurial\osutil.pyc", line 10, in __load ImportError: DLL load failed: The specified module could not be found.
我在 SO 和其他地方找到的其他答案让我尝试从源代码安装,将纯 osutil 放入安装中,或者安装旧版本。我都试过了。
这尤其令人沮丧,因为我有其他类似的非虚拟机机器运行良好但无法找到断开连接。
想法?
最佳答案
我使用以下系统配置时遇到同样的错误
- Python-2.6.6 安装为 msi
- mercurial-1.8.2-x86 安装为 msi
- IIS7
我简单地解决了这个问题:
- Python已经提前安装好
- 卸载 Mercurial msi 包
- 从 mercurial website 下载并安装“Mercurial-1.8.2(32 位 py2.6)”安装程序标记为“推荐用于 hgweb 设置”。
- 将C:\Python26\Lib\site-packages\mercurial\的内容复制到IIS7网站设置中使用的目录。
到目前为止一切正常。希望这会有所帮助。
关于python - Mercurial CGI (hgweb.cgi) 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5318970/