mercurial hgweb.cgi和python的匹配版本是什么
Mercurial版本是1.9.1mercurial hgweb.cgi和python的匹配版本是什么,python,mercurial,Python,Mercurial,Mercurial版本是1.9.1 C:\Inetpub\hgweb>hg version Mercurial Distributed SCM (version 1.9.1) (see http://mercurial.selenic.com for more information) Copyright (C) 2005-2011 Matt Mackall and others This is free software; see the source for copying cond
C:\Inetpub\hgweb>hg version
Mercurial Distributed SCM (version 1.9.1)
(see http://mercurial.selenic.com for more information)
Copyright (C) 2005-2011 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
我正试图运行位于mercurial的文件“hgweb.cgi”
尝试使用Python2.5、2.7和3.2,但仍然会出现幻数错误
C:\Inetpub\hgweb>c:\Python25\python.exe hgweb.cgi
Traceback (most recent call last):
File "hgweb.cgi", line 15, in <module>
from mercurial import demandimport; demandimport.enable()
ImportError: Bad magic number in C:\Inetpub\hgweb\mercurial\__init__.pyc
C:\Inetpub\hgweb>c:\Python27\python.exe hgweb.cgi
Traceback (most recent call last):
File "hgweb.cgi", line 15, in <module>
from mercurial import demandimport; demandimport.enable()
ImportError: Bad magic number in C:\Inetpub\hgweb\mercurial\__init__.pyc
C:\Inetpub\hgweb>c:\Python32\python.exe hgweb.cgi
Traceback (most recent call last):
File "hgweb.cgi", line 15, in <module>
from mercurial import demandimport; demandimport.enable()
ImportError: Bad magic number in C:\Inetpub\hgweb\mercurial\__init__.pyc
C:\Inetpub\hgweb>C:\Python25\python.exe hgweb.cgi
回溯(最近一次呼叫最后一次):
文件“hgweb.cgi”,第15行,在
来自mercurial进口港;demandimport.enable()
ImportError:C:\Inetpub\hgweb\mercurial\\uuuu init\uuuu.pyc中的错误幻数
C:\Inetpub\hgweb>C:\Python27\python.exe hgweb.cgi
回溯(最近一次呼叫最后一次):
文件“hgweb.cgi”,第15行,在
来自mercurial进口港;demandimport.enable()
ImportError:C:\Inetpub\hgweb\mercurial\\uuuu init\uuuu.pyc中的错误幻数
C:\Inetpub\hgweb>C:\Python32\python.exe hgweb.cgi
回溯(最近一次呼叫最后一次):
文件“hgweb.cgi”,第15行,在
来自mercurial进口港;demandimport.enable()
ImportError:C:\Inetpub\hgweb\mercurial\\uuuu init\uuuu.pyc中的错误幻数
python应该使用什么版本
编辑#2
我重新复制位于hgweb.cgi附近mercurial中的Library.zip内容,例外情况是“没有名为mercurial的模块”。但是有一个名为“mercurial”的文件夹,其中包含pyo文件。(尝试了其他python版本2.7、3.2,错误相同)
详情:
<type 'exceptions.ImportError'> Python 2.5.4: C:\Python25\python.exe
Thu Aug 11 23:24:26 2011
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
C:\Inetpub\hgweb\hgweb.cgi in ()
13 import cgitb; cgitb.enable()
14
15 from mercurial import demandimport; demandimport.enable()
16 from mercurial.hgweb import hgweb, wsgicgi
17 application = hgweb(config)
mercurial undefined, demandimport undefined
<type 'exceptions.ImportError'>: No module named mercurial
args = ('No module named mercurial',)
message = 'No module named mercurial'
python2.5.4:C:\Python25\Python.exe
2011年8月11日星期四23:24:26
Python脚本中出现问题。下面是导致错误的函数调用序列,按发生顺序排列。
C:\Inetpub\hgweb\hgweb.cgi在()中
13进口cgitb;cgib.enable()
14
15来自mercurial进口港;demandimport.enable()
16从mercurial.hgweb导入hgweb,wsgicgi
17应用程序=hgweb(配置)
mercurial未定义,demandimport未定义
:没有名为mercurial的模块
args=('No module named mercurial',)
消息='没有名为mercurial的模块'
编辑3
已安装Python2.6
新的错误是:
Traceback (most recent call last):
File "C:\Inetpub\hgweb\hgweb.cgi ", line 17, in <module>
application = hgweb(config)
File "mercurial\hgweb\__init__.pyc", line 26, in hgweb
File "mercurial\hgweb\hgwebdir_mod.pyc", line 62, in __init__
||ƒSt|iƒ}|}xæ|oŞ|i|ƒ} | o™||id
File "mercurial\hgweb\hgwebdir_mod.pyc", line 71, in refresh
|||ƒS|it|ƒ|dd|ƒSWn<tj
File "mercurial\ui.pyc", line 43, in __init__
|iƒ|djotiidƒ}n|id|ƒdS(NtsectionstremapsIgnored: %s
File "mercurial\demandimport.pyc", line 75, in __getattribute__
File "mercurial\demandimport.pyc", line 47, in _load
_demandimportQs:"
File "mercurial\scmutil.pyc", line 164, in <module>
File "mercurial\scmutil.pyc", line 180, in opener
(R÷tctx(smercurial\scmutil.pyctbadfn;s(R-(RRŸRØtbad(RRştoptsRRßR((R÷Rsmercurial\scmutil.pycRŸ3s
File "mercurial\demandimport.pyc", line 75, in __getattribute__
File "mercurial\demandimport.pyc", line 47, in _load
_demandimportQs:"
File "mercurial\util.pyc", line 503, in <module>
File "mercurial\demandimport.pyc", line 85, in _demandimport
File "mercurial\windows.pyc", line 21, in <module>
cCscy|iiƒSWnKtj
File "mercurial\demandimport.pyc", line 75, in __getattribute__
File "mercurial\demandimport.pyc", line 47, in _load
_demandimportQs:"
File "mercurial\osutil.pyc", line 12, in <module>
File "mercurial\osutil.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.
回溯(最近一次呼叫最后一次):
文件“C:\Inetpub\hgweb\hgweb.cgi”,第17行,在
应用程序=hgweb(配置)
文件“mercurial\hgweb\\ uuuuu init\ uuuuu.pyc”,第26行,在hgweb中
文件“mercurial\hgweb\hgwebdir_mod.pyc”,第62行,在_init中__
||ƒSt|i|}x|o|350; i|o™||身份证件
文件“mercurial\hgweb\hgwebdir_mod.pyc”,第71行,刷新
|||ƒS|it | dd | SWn您需要在Mercurial所基于的Python版本下运行此功能。不幸的是,常见问题解答没有提到这是什么,我无法在我当前的系统上打开.msi,因此您需要检查“pythonXX.dll”或与TortoiseHG一起安装的某个库,并将其与Python的小版本一起使用。可能想提及您的Mercurial是从哪里获得的,以便其他人可以检查包。首先使用了“”中最新的mercurial源代码,但它抛出了“magic number”错误。然后我使用了最新的OrtoiseHG 2.1.2(它附带mercurial 1.9.1),但它不能导入mercurial。(ps我正在提取library.zip内容)这为我解决了问题: