2012-09-14 102 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