pip无法安装PIL或mt.exe错误的枕头 [英] pip fails to install PIL or Pillow with mt.exe error

查看:125
本文介绍了pip无法安装PIL或mt.exe错误的枕头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

On one of my Windows 7 development machines, I am attempting to install the Python Image Library.

我的机器很相似.两者都运行Windows 7 Professional x64.两者都使用Python 2.7.3(32位).在其中一台计算机上,pip install PIL正常运行.另一方面,它以跟踪结束而失败:

My machines are similar. Both run Windows 7 Professional, x64. Both use Python 2.7.3 (32bit). On one of the machine pip install PIL works fine. On the other it fails with the trace ending with this:

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

如何解决此错误?

推荐答案

感谢 http://bugs.python .org/issue4431 ,此错误已通过以下方式修复:

Thanks to http://bugs.python.org/issue4431, this error was fixed by modifying:

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

并添加:

 ld_args.append('/MANIFEST')

在MANIFESTFILE行之后,如下所示:

after the MANIFESTFILE line so it looks like:

        # 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:").

If you still get the error, then change the if arg.startswith("/MANIFESTFILE:") to if arg.startswith("/MANIFEST:") in the manifest_get_embed_info(self, target_desc, ld_args) method.

这篇关于pip无法安装PIL或mt.exe错误的枕头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆