【问题标题】:pip fails to install PIL or Pillow with mt.exe errorpip 无法安装 PIL 或 Pillow 并出现 mt.exe 错误
【发布时间】:2012-09-07 06:39:16
【问题描述】:

在我的一台 Windows 7 开发机器上,我正在尝试安装 Python 图像库。

我的机器是类似的。两者都运行 Windows 7 Professional,x64。两者都使用 Python 2.7.3(32 位)。在其中一台机器上pip install PIL 工作正常。另一方面,它失败了,跟踪以这个结尾:

build\temp.win-amd64-2.7\Release\_imaging.pyd.manifest : general error c1010070:
 Failed to load and parse the manifest. The system cannot find the file specified.

error: command 'mt.exe' failed with exit status 31

我该如何解决这个错误?

【问题讨论】:

    标签: python windows-7 python-imaging-library pip


    【解决方案1】:

    感谢http://bugs.python.org/issue4431,通过修改修复了这个错误:

    C:\<Python dir>\Lib\distutils\msvc9compiler.py
    

    并添加:

     ld_args.append('/MANIFEST')
    

    在 MANIFESTFILE 行之后,它看起来像:

            # Embedded manifests are recommended - see MSDN article titled
            # "How to: Embed a Manifest Inside a C/C++ Application"
            # (currently at http://msdn2.microsoft.com/en-us/library/ms235591(VS.80).aspx)
            # Ask the linker to generate the manifest in the temp dir, so
            # we can embed it later.
            temp_manifest = os.path.join(
                    build_temp,
                    os.path.basename(output_filename) + ".manifest")
            ld_args.append('/MANIFESTFILE:' + temp_manifest)
            ld_args.append('/MANIFEST')
    

    如果仍然出现错误,则在manifest_get_embed_info(self, target_desc, ld_args) 方法中将if arg.startswith("/MANIFESTFILE:") 更改为if arg.startswith("/MANIFEST:")

    【讨论】:

      【解决方案2】:

      如果你已经到达这里寻找

      general error c1010070:
       Failed to load and parse the manifest. The system cannot find the file specified.
      
      error: command 'mt.exe' failed with exit status 31
      

      以下是适用于 Windows 8/x64/Python 3.3/VS 11 的解决方法:

      # py 3.3 seems to be compiled against VS 2010 compiler, force using VS11 cl.exe for us
      $env:VS100COMNTOOLS=$env:VS110COMNTOOLS
      
      # Modify C:\Python33\lib\distutils\msvc9compiler.py
      # Comment line 670:         ld_args.append('/MANIFESTFILE:' + temp_manifest)
      # Basically it will instruct build to not look for manifest file
      

      【讨论】:

        【解决方案3】:

        从 pypi 下载压缩包,并尝试在您的机器上构建和安装。这个 link 可以给你一些提示。这仅能解决您的问题,但安装会有所不同。

        【讨论】:

          猜你喜欢
          • 2021-12-17
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-04-15
          相关资源
          最近更新 更多