在IIS7 64位上安装Mercurial时出错:“DLL加载失败:%1不是有效的Win32应用程序”

2024-04-29 05:45:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在IIS7网络服务器上安装Mercurial,使用指南:http://pteradigm.com/2012/09/16/mercurial-on-iis-7-x86-or-x64/#hg_iis_python

我使用以下版本:

  • python-2.7.6.amd64
  • pywin32-218.win-amd64-py2.7
  • 汞-2.8.2.焦油
  • Windows Server 2008 R2

我已经将python和python\scripts文件夹添加到“Path”环境变量中。在

当我需要编译hgwebdir时_wsgi.py在DLL中,我尝试使用管理命令提示符编译hgwebdir_wsgi.py我得到以下错误:

C:\inetpub\wwwroot\hg>python hgwebdir_wsgi.py
Traceback (most recent call last):
  File "hgwebdir_wsgi.py", line 73, in <module>
    application = hgwebdir(hgweb_config)
  File "C:\Python27\lib\site-packages\mercurial\hgweb\hgwebdir_mod.py", line 89,
 in __init__
    self.refresh()
  File "C:\Python27\lib\site-packages\mercurial\hgweb\hgwebdir_mod.py", line 98,
 in refresh
    u = ui.ui()
  File "C:\Python27\lib\site-packages\mercurial\ui.py", line 45, in __init__
    for f in scmutil.rcpath():
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 102, in _
_getattribute__
    self._load()
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 74, in _l
oad
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 43, in _h
gextimport
    return importfunc(name, globals, *args)
  File "C:\Python27\lib\site-packages\mercurial\scmutil.py", line 290, in <modul
e>
    class vfs(abstractvfs):
  File "C:\Python27\lib\site-packages\mercurial\scmutil.py", line 318, in vfs
    @util.propertycache
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 102, in _
_getattribute__
    self._load()
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 74, in _l
oad
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 43, in _h
gextimport
    return importfunc(name, globals, *args)
  File "C:\Python27\lib\site-packages\mercurial\util.py", line 27, in <module>
    cachestat = platform.cachestat
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 102, in _
_getattribute__
    self._load()
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 74, in _l
oad
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 43, in _h
gextimport
    return importfunc(name, globals, *args)
  File "C:\Python27\lib\site-packages\mercurial\windows.py", line 36, in <module
>
    posixfile.__doc__ = osutil.posixfile.__doc__
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 102, in _
_getattribute__
    self._load()
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 74, in _l
oad
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "C:\Python27\lib\site-packages\mercurial\demandimport.py", line 43, in _h
gextimport
    return importfunc(name, globals, *args)
ImportError: DLL load failed: %1 is not a valid Win32 application.

大多数相关问题的答案是32位vs 64位问题:然而,我使用了Python和Pywin的64位版本,并从源代码构建了mercurial(或者,正在尝试)。为什么我的编译失败了?在


Tags: inpyselfmodlibpackageslinesite
1条回答
网友
1楼 · 发布于 2024-04-29 05:45:38

我无法用这个版本的Mercurial解决这个问题。最终成功的是两者兼而有之

  1. 使用稍旧版本的Mercurial
  2. 切换到32位所有。在

尽管我之前很小心地只安装了64位版本,但我认为在某个地方添加了一个32位的版本-至少,我是这么认为的,因为32位的工作就在门外。我怀疑Mercurial的老版本是它工作的原因,但是我确实改变了版本,所以我把它包含在我的答案中。在

我给其他有这个问题的人的建议是:不管你的处理器是什么,切换到统一的32位。在

相关问题 更多 >