3

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

我的机器类似。两者都运行 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

如何解决此错误?

4

3 回答 3

31

感谢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')

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

于 2013-11-18T14:28:05.183 回答
1

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

于 2012-09-14T06:14:25.390 回答
1

如果你已经到达这里寻找

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
于 2013-09-09T06:39:01.473 回答