Mercurial hgweb.cgi 和 python 匹配版本是什么

发布于 2024-11-29 01:40:50 字数 3831 浏览 0 评论 0原文

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 conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

运行位于 Mercurial 的文件“hgweb.cgi”,

,我尝试使用 python 2.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

但我仍然收到幻数错误。我应该使用什么版本的Python?

编辑#2

我重新复制位于 Mercurial 中 hgweb.cgi 附近的 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'

编辑3

安装了python 2.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.

Mercurial version is 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 conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

and i'm trying to run the file "hgweb.cgi" located at mercurial

tried with python 2.5, 2.7 and 3.2 but i'm still getting the magic number error.

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

What version should i use for python?

Edit #2

I re-copy the Library.zip contents located in mercurial near to hgweb.cgi and the exception is "No module named mercurial". but there's a folder named 'mercurial' and it contains pyo files. (Tried other python version 2.7, 3.2 and error is the same)

details:

<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'

Edit 3

Installed python 2.6

And the new error is :

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨的味道风的声音 2024-12-06 01:40:50

您需要在 Mercurial 构建的 Python 版本下运行它。不幸的是,常见问题解答没有提到这是什么,我无法在当前系统上打开 .msi,因此您需要检查“pythonXX.dll”或随 TortoiseHG 安装的一些此类库,并将其与该次要版本一起使用Python 的。

You will need to run this under the version of Python that Mercurial is built against. Unfortunately the FAQ doesn't mention what this is and I can't open a .msi on my current system so you will need to check for a "pythonXX.dll" or some such library installed with TortoiseHG and use it with that minor version of Python.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文