Mercurial CGI(hgweb.cgi)失败

时间:2011-03-15 22:43:48

标签: python mercurial windows-server-2008

我在运行在vm上的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放入安装或安装旧版本。我试过了所有这些。

这特别令人沮丧,因为我有其他类似的非虚拟机运行良好但无法找到断开连接。

想法?

2 个答案:

答案 0 :(得分:18)

使用以下系统配置我有同样的错误

  • 以msi
  • 安装的Python-2.6.6
  • 以msi
  • 安装的mercurial-1.8.2-x86
  • IIS7

我简单地解决了这个问题:

  1. 早期安装了Python
  2. 卸载Mercurial msi包
  3. mercurial website下载并安装“Mercurial-1.8.2(32位py2.6)”安装程序,标记为“建议用于hgweb设置”。
  4. 将C:\ Python26 \ Lib \ site-packages \ mercurial \的内容复制到IIS7网站设置中使用的目录。
  5. 直到现在一切正常。希望这会有所帮助。

答案 1 :(得分:1)

每当我有一些描述性错误消息告诉我系统级正在发生的事情而不是是什么时,我会使用Sysinternals' Procmon来告诉我注册表和文件系统的内容。它很冗长,让过滤器只显示感兴趣的过程需要一些学习,但您可以将结果导出到Excel并浏览它们以获得可疑的结果。当然要特别注意失败。

试试看看正在搜索的DLL。