【发布时间】:2011-05-20 07:23:33
【问题描述】:
我正在尝试让 Mercurial 托管在 IIS 7.5(Win 7 x64)上,但一直遇到我似乎无法修复的错误。
我在这里学习了 Jeremy Skinners 的教程:Mercurial on IIS7
我使用的是 hgweb,而不是 hgwebdir,因为我使用的是 Mercurial 1.7.2
我已经安装并运行了 python。我在目录 c:\inetpub\wwwroot\hg 中的 http://localhost/hg -> 为 Mercurial 设置了一个 IIS 应用程序
我将模板目录放入 c:\inetpub\wwwroot\hg 我将 library.zip 文件解压缩到 c:\inetpub\wwwroot\hg
当我访问该站点时,我收到一个错误 -> 文件“C:\inetpub\wwwroot\hg\hgweb.cgi”,第 15 行,in from mercurial import demandimport; demandimport.enable() ImportError: No module named mercurial ".
在搜索这个错误时,我找到了以下答案:https://stackoverflow.com/questions/2123798/
根据接受的答案,我将 hgweb.cgi 更改为如下所示:
#!c:/python/python26/python.exe
#
# An example hgweb CGI script, edit as necessary
# See also https://www.mercurial-scm.org/wiki/PublishingRepositories
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/path/to/repo/or/config"
# Uncomment and adjust if Mercurial is not installed system-wide:
import sys; sys.path.insert(0, "c:\inetpub\wwwroot\hg")
# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb('c:\inetpub\wwwroot\hg\hgweb.config')
wsgicgi.launch(application)
这样做之后,我仍然得到同样的错误。我不知道还能做什么。任何帮助将不胜感激。
Edi 1:c:\inetpub\wwwroot\hg 的屏幕截图(根据请求):
【问题讨论】:
-
你能张贴 c:\inetpub\wwwroot\hg 内容的截图或其他内容吗?也许这些文件最终位于它们应有的子目录中。
-
@Lasse 根据您的要求发布了屏幕截图。
-
我遇到了同样的错误并研究了解决方案然后创建了comprehensive instructions to setup mercurial hgweb on iis7
-
我知道这篇文章很旧,但你的链接现在在 403 后面 @Firegarden
标签: python iis mercurial hgweb