首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IIS 7.5上的Mercurial和hgweb - python错误

IIS 7.5上的Mercurial和hgweb - python错误
EN

Stack Overflow用户
提问于 2010-12-05 03:01:04
回答 3查看 7.2K关注 0票数 9

我试图让Mercurial在IIS7.5(Win7 x64)上运行,但一直运行着一个我似乎无法修复的错误。

我在这里关注了Jeremy Skinners的教程:Mercurial on IIS7

我使用的是hgweb而不是hgwebdir,因为我使用的是Mercurial 1.7.2

我已经安装了python,并且可以正常工作。我在http://localhost/hg ->的c:\inetpub\wwwroot\hg目录中为Mercurial设置了一个IIS应用程序

我将模板目录放在c:\inetpub\wwwroot\hg中,并将library.zip文件解压缩到c:\inetpub\wwwroot\hg中

当我访问该站点时,我收到错误->文件"C:\inetpub\wwwroot\hg\hgweb.cgi“,第15行,来自mercurial import demandimport;demandimport.enable() ImportError: No module named mercurial”。

在搜索此错误时,我找到了以下答案:https://stackoverflow.com/questions/2123798/

按照公认的答案,我更改了我的hgweb.cgi,如下所示:

代码语言:javascript
复制
#!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的屏幕截图:

EN

回答 3

Stack Overflow用户

发布于 2011-03-25 23:19:13

Adam Boddington已经写了一个更新的安装描述,现在可以工作了:http://stackingcode.com/blog/2011/02/24/running-a-mercurial-server-on-iis-7-5-windows-server-2008-r2

票数 3
EN

Stack Overflow用户

发布于 2011-06-28 13:14:21

我使用当前版本的Mercurial (1.8.x)以及当前版本的Python2.7编写了up to date instructions on how to setup a mercurial repository on IIS7

这将为你工作,如果你用它来投票支持(或反对;)),我很感激。

票数 3
EN

Stack Overflow用户

发布于 2010-12-30 23:19:42

我之前确实有很多错误。卸载所有的python,pywin32,isapi_wsgi和上面安装的。它就像微风一样起作用。Luc

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4355256

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档