python进行图像处理,刚开始就出现如下错误,请问应该怎么解决
>>>importPIL.ImageasImage>>>img=Image.open("1.jpg")>>>new_img=img.resize((128,128),Im...
>>> import PIL.Image as Image
>>> img = Image.open("1.jpg")
>>> new_img = img.resize((128,128),Image.BILINEAR)
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
new_img = img.resize((128,128),Image.BILINEAR)
File "F:\Python2.7\lib\site-packages\PIL\Image.py", line 1290, in resize
self.load()
File "F:\Python2.7\lib\site-packages\PIL\ImageFile.py", line 164, in load
self.load_prepare()
File "F:\Python2.7\lib\site-packages\PIL\ImageFile.py", line 231, in load_prepare
self.im = Image.core.new(self.mode, self.size)
File "F:\Python2.7\lib\site-packages\PIL\Image.py", line 37, in __getattr__
raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed 展开
>>> img = Image.open("1.jpg")
>>> new_img = img.resize((128,128),Image.BILINEAR)
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
new_img = img.resize((128,128),Image.BILINEAR)
File "F:\Python2.7\lib\site-packages\PIL\Image.py", line 1290, in resize
self.load()
File "F:\Python2.7\lib\site-packages\PIL\ImageFile.py", line 164, in load
self.load_prepare()
File "F:\Python2.7\lib\site-packages\PIL\ImageFile.py", line 231, in load_prepare
self.im = Image.core.new(self.mode, self.size)
File "F:\Python2.7\lib\site-packages\PIL\Image.py", line 37, in __getattr__
raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed 展开
3个回答
展开全部
什么版本的python?media module是哪个?python2.x中有imageop这个module4其中imageop.scale(image, psize, width, height newwidth, newheight)就能满足你的要求cgpython3.x中好像没有自带的图像处理模块o可以用第三方的module,如PIL之类的4062
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
重新安装PIL
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-07-24
展开全部
重新安装aa
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询