PIP无法安装PIL或枕头与mt.exe错误(pip fails to install PIL or

2019-07-31 13:41发布

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

我的机器是相似的。 这两种运行Windows 7专业版,64位。 无论使用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

我怎样才能解决这个问题?

Answer 1:

由于http://bugs.python.org/issue4431 ,这个错误是固定的修改:

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

并补充说:

 ld_args.append('/MANIFEST')

在manifest资源配置文件行之后,所以它看起来像:

        # 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)方法。



Answer 2:

从PyPI将下载的压缩包,并尝试建立在你的机器上安装。 此链接可以给你一些提示。 恰好只有你的问题,但涉及的安装变化。



Answer 3:

如果你已经到达这里寻找

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/64 / 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


文章来源: pip fails to install PIL or Pillow with mt.exe error