pip无法安装PIL或Pillow mt.exe错误

时间:2012-09-14 05:41:17

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

在我的一台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

如何解决此错误?

3 个答案:

答案 0 :(得分:30)

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

答案 1 :(得分:1)

从pypi下载压缩包,尝试在您的计算机上构建和安装。 link 可以为您提供一些提示。这只是解决您的问题,但安装方式各不相同。

答案 2 :(得分: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