PIL报错:The _imaging C module is not installed
来源:互联网 发布:淘宝充值方式 编辑:程序博客网 时间:2024/05/15 22:38
这是我的第一篇博客。从今天开始,我打算记录一下学习过程中遇到的一些问题以及解决方法。当然咯,由于我自己只是个菜鸟,目前只能先转载一下别人的博客,内容稍作整理,也算是自己的一个学习笔记吧。
最近我在看一些利用机器学习对恶意代码进行分类的工作,来自这个链接:http://www.tuicool.com/articles/um6VNnz
问题来源:
之前我从没写过python代码,所以照着他给的代码码了一遍,这是一段将一个二进制文件转换成灰度图的python代码:
#!pythonimport numpyfrom PIL import Imageimport binasciidef getMatrixfrom_bin(filename,width):with open(filename, 'rb') as f:content = f.read()hexst = binascii.hexlify(content) #将二进制文件转换为十六进制字符串fh = numpy.array([int(hexst[i:i+2],16) for i in range(0, len(hexst), 2)]) #按字节分割rn = len(fh)/widthfh = numpy.reshape(fh[:rn*width],(-1,width)) #根据设定的宽度生成矩阵fh = numpy.uint8(fh)return fhfilename = "your_bin_filename"im = Image.fromarray(getMatrixfrom_bin(filename,512)) #转换为图像im.save("your_img_filename.png")
问题描述:
我安装好PIL库和numpy库后运行上述代码,会出现以下错误:
ImportError: The _imaging C module is not installed
解决办法:
去这个网站https://pypi.python.org/pypi/Pillow/2.1.0#id2
下一个Pillow-2.1.0.win-amd64-py2.7.exe(md5)64位版本的即可。
参考:http://blog.csdn.net/tianxiawuzhei/article/details/44922843
0 0
- PIL报错:The _imaging C module is not installed
- PIL The _imaging C module is not installed
- The _imaging C module is not installed
- The _imaging C module is not installed
- The _imaging C module is not installed 转载
- The _imaging C module is not installed ---mark
- 解决PIL “decoder jpeg not available” 和 “ImportError: The _imaging C module is not installed”的问题
- python__The _imaging C module is not installed
- python PIL ImportError: The _imagingft C module is not installed
- PIL “The _imagingft C module is not installed” 错误补救
- Pillow-PIL的完全Fok替代库--完美解决报错The _imagingft C module is not installed的解决方案
- ImportError: The _imaging C module is not installed错误解决记录
- python中PIL库在使用时出现The _imagingft C module is not installed错误
- 用pil产生验证码出现:ImportError: The _imagingft C module is not installed
- PIL写入字体出现ImportError:The _imagingft C module is not installed 错误的解决方法
- Python 的PIL,可以解决ImportError The _imagingft C module is not installed
- 解决Windows下PIL库的"The _imagingft C module is not installed"错误
- Windows系统下,报错The _imagingft C module is not installed
- unzip
- js抽象工厂模式
- java多态详解
- TextView 的隐藏技能
- [java]内部类
- PIL报错:The _imaging C module is not installed
- 宏定义中使用do{}while(0)的好处
- Spring使用@Autowired注解自动装配
- RecycleView 底部监听
- 使用tensorflow构建简单卷积神经网络
- C语言小程序——字符串的比对与替换
- java基础语法(5)
- 304. Range Sum Query 2D
- hiho一下 第136周 #1269 : 优化延迟 【二分+堆排序|优先队列】