我刚刚在虚拟环境中安装了Pillow包。具体操作如下:
from PIL import Image, ImageFont, ImageDraw
ImageFont.load_path('some_path')
我遇到了一个错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/net/isilonP/public/rw/homes/cbl_adm/.virtualenvs/chembl_webservices/lib/python2.7/site-packages/PIL/ImageFont.py", line 264, in load_path
if not isinstance(filename, "utf-8"):
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types
确实,如果您查看官方的Github存储库(https://github.com/python-imaging/Pillow/blob/master/PIL/ImageFont.py#L264),您可以看到这个结构:
if not isinstance(filename, "utf-8"):
...
我的问题是:如何用实际可行的东西替换它?