2012-09-14 61 views
1

在我的Windows 7开发机器之一,我试图安装Python图像库。pip无法安装PIL或枕头与mt.exe错误

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

如何解决此错误?

回答

28

由于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') 
+4

这必须是公认的答案。 –

+0

像一个魅力工作。非常感谢。 –

1

从pypi下载压缩包,并尝试在您的机器上构建和安装。这link可以给你一些提示。这完全处理您的问题,但安装不同。

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