ImportError: No module named PIL

add at 2013/08/21 : 

试试PIL库
www.pythonware.com/products/pil/

【ps:只有32位的库】 

 

ImportError: No module named PIL

查到问题解决方案:

1:不通过 from PIL import Image 而直接 import Image

2:查看目录python安装目录 C:\Python27\Lib\site-packages下没有PIL目录,说明没安装PIL,通过命令 pip install pil,再次查看那个目录,出现了PIL,安装完成,收工。

 

执行命令pip install pil时,又遇到问题:error: Unable to find vcvarsall.bat

For Windows installations:

While running setup.py for package installations Python 2.7 searches for an installed Visual Studio 2008. You can trick Python to use a newer Visual Studio by setting the correct path in VS90COMNTOOLS environment variable before calling setup.py.

If you have Visual Studio 2010 installed, execute

SET VS90COMNTOOLS=%VS100COMNTOOLS%

or with Visual Studio 2012 installed

SET VS90COMNTOOLS=%VS110COMNTOOLS%

picked from :http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat

posted on 2013-08-20 21:41  JohnChain  阅读(5612)  评论(0编辑  收藏  举报

导航