linux mint 13开始就发现这个问题了,一直不知道怎么解决,今天突然发现了解决方案,来分享给大家

下面是修改对比,自己根据修改,这个是系统文件,需要root权限,路径/usr/lib/python2.7/dist-packages/PIL/ImageDraw.py

 +import numbers
+
from PIL import Image, ImageColor try:
@@ -98,7 +100,7 @@ def setink(self, ink):
)
if Image.isStringType(ink):
ink = ImageColor.getcolor(ink, self.mode)
- if self.palette and not Image.isNumberType(ink):
+ if self.palette and not isinstance(ink, numbers.Number):
ink = self.palette.getcolor(ink)
self.ink = self.draw.draw_ink(ink, self.mode) @@ -141,13 +143,13 @@ def _getink(self, ink, fill=None):
if ink is not None:
if Image.isStringType(ink):
ink = ImageColor.getcolor(ink, self.mode)
- if self.palette and not Image.isNumberType(ink):
+ if self.palette and not isinstance(ink, numbers.Number):
ink = self.palette.getcolor(ink)
ink = self.draw.draw_ink(ink, self.mode)
if fill is not None:
if Image.isStringType(fill):
fill = ImageColor.getcolor(fill, self.mode)
- if self.palette and not Image.isNumberType(fill):
+ if self.palette and not isinstance(fill, numbers.Number):
fill = self.palette.getcolor(fill)
fill = self.draw.draw_ink(fill, self.mode)
return ink, fill

修改完之后就不会报错了

  File "/usr/lib/python2.7/dist-packages/PIL/ImageDraw.py", line 256, in text
ink, fill = self._getink(fill)
File "/usr/lib/python2.7/dist-packages/PIL/ImageDraw.py", line 144, in _getink
if self.palette and not Image.isNumberType(ink):
AttributeError: 'module' object has no attribute 'isNumberType'

针对PIL中ImageDraw.py报错的解决方案的更多相关文章

  1. 关于Entity Framework中的Attached报错相关解决方案的总结

    关于Entity Framework中的Attached报错的问题,我这里分为以下几种类型,每种类型我都给出相应的解决方案,希望能给大家带来一些的帮助,当然作为读者的您如果觉得有不同的意见或更好的方法 ...

  2. django中执行py报错Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured

    https://blog.csdn.net/heybob/article/details/49684261 django代码下面直接run的时候报错: django.core.exceptions.I ...

  3. Djianggo 在windows中安装出现报错的解决方案

    Djianggo 在win7下 安装会报错 Traceback (most recent call last):File "setup.py", line 4, in <mo ...

  4. python命令行中import caffe报错的解决方案

    1.ImportError: No module named skimage.io >>> import caffe Traceback (most recent call last ...

  5. Django中修改DATABASES后,执行python manage.py ****报错!UnicodeEncodeError

    Django中修改DATABASES后,执行python manage.py ****报错!UnicodeEncodeError: 'latin-1' codec can't encode chara ...

  6. 关于Entity Framework中的Attached报错的完美解决方案终极版

    之前发表过一篇文章题为<关于Entity Framework中的Attached报错的完美解决方案>,那篇文章确实能解决单个实体在进行更新.删除时Attached的报错,注意我这里说的单个 ...

  7. Aasible中cryptography兼容性报错解决办法

    Aasible中cryptography兼容性报错解决办法 1 Ansible中使用ansible --version查看版本,报错信息如下: ERROR! Unexpected Exception, ...

  8. pytest——pycharm中右击运行(run)没有问题,在terminal中运行pytest报错:E ModuleNotFoundError: No module named

    参考了这个解决办法:https://blog.csdn.net/qq_36829091/article/details/82180866 我的是Windows,linux的和Windows的解决办法有 ...

  9. 解决MyEclipse中的js报错的小方法

    今天,下了个模版,但是导进去的时候发现js会报错.看了下其他都没有错误.而有一个js报错误,请原谅我有点红色强迫症,不能留一点红色 . 错误如下:Syntax error on token " ...

随机推荐

  1. jQuery的动画效果

    jQuery 是一个 JavaScript 库.jQuery 库可以通过一行简单的标记被添加到网页中. <script type="text/javascript" src= ...

  2. SQL Server2008创建约束图解 转

    转自 http://www.cnblogs.com/longhs/p/3670307.html SQLServer 中有五种约束, Primary Key 约束. Foreign Key 约束. Un ...

  3. autoscan; aclocal; autoconf; automake --add-missing; ./configure; make

    1.autoscan 在源码目录下执行autoscan,生成configure.scan,重命名为configure.in或者configure.ac,然后编辑文件内容: ============== ...

  4. js实现归并排序

    function merge(s_arr, d_arr, start, middle, end){ var s_temp = start; var m_temp = middle+1; var tem ...

  5. 关于eclipse中删除多余的工作空间记录

    这个Eclipse是拷贝的别人的,前三个是别人在使用这个Eclipse的时候定义的路径,到我本地机器是多余的.如何删除这三个默认的工作空间路径. 这个路径的list是读取的Eclipse中的一个文件, ...

  6. Linux串口编程(转载)

    在嵌入式Linux中,串口是一个字设备,访问具体的串行端口的编程与读/写文件 的操作类似,只需打开相应的设备文件即可操作.串口编程特殊在于串 口通信时相关参数与属性的设置.嵌入式Linux的串口编程时 ...

  7. 转: utf16编码格式(unicode与utf16联系)

    转自: http://www.cnblogs.com/dragon2012/p/5020259.html UTF-16是Unicode字符集的一种转换方式,即把Unicode的码位转换为16比特长的码 ...

  8. Web前端学习笔记1

    Day1. 1.Windows常用快捷键. 快捷键 功能 ctrl+c 复制 ctrl+v 粘贴 ctrl+x 剪切(复制和剪切后都可以粘贴) ctrl+a 全选 ctrl+s 保存 ctrl+tab ...

  9. CXF(2.7.10) - Writing a service with Spring

    1. 定义服务接口. package com.huey.demo.ws; import javax.jws.WebParam; import javax.jws.WebService; @WebSer ...

  10. MongoDB - Introduction to MongoDB, Capped Collections

    Overview Capped collections are fixed-size collections that support high-throughput operations that ...