我刚刚安装了py-game和pytagcloud以创建一个词云。导入库或创建“标签”时,我没有问题。但是,只要我尝试渲染实际图像,我就会收到以下错误消息
Traceback (most recent call last):
File "/Users/harry/anaconda/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2885, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-34-4b17e94bd116>", line 1, in <module>
create_tag_image(tags, 'cloud_large.png', size=(900, 600), fontname='Lobster')
File "/Users/harry/anaconda/lib/python3.5/site-packages/pytagcloud/__init__.py", line 344, in create_tag_image
rectangular=rectangular)
File "/Users/harry/anaconda/lib/python3.5/site-packages/pytagcloud/__init__.py", line 275, in _draw_cloud
tag_sprite = Tag(tag, (0, 0), fontname=fontname)
File "/Users/harry/anaconda/lib/python3.5/site-packages/pytagcloud/__init__.py", line 62, in __init__
self.tag['size'])
OSError: unable to read font file '/Users/harry/anaconda/lib/python3.5/site-packages/pytagcloud/fonts/Lobster.ttf'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/harry/anaconda/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 1827, in showtraceback
stb = value._render_traceback_()
AttributeError: 'OSError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/harry/anaconda/lib/python3.5/site-packages/IPython/core/ultratb.py", line 1120, in get_records
File "/Users/harry/anaconda/lib/python3.5/site-packages/IPython/core/ultratb.py", line 301, in wrapped
File "/Users/harry/anaconda/lib/python3.5/site-packages/IPython/core/ultratb.py", line 346, in _fixed_getinnerframes
File "/Users/harry/anaconda/lib/python3.5/inspect.py", line 1453, in getinnerframes
File "/Users/harry/anaconda/lib/python3.5/inspect.py", line 1410, in getframeinfo
File "/Users/harry/anaconda/lib/python3.5/inspect.py", line 672, in getsourcefile
File "/Users/harry/anaconda/lib/python3.5/inspect.py", line 701, in getmodule
File "/Users/harry/anaconda/lib/python3.5/inspect.py", line 685, in getabsfile
File "/Users/harry/anaconda/lib/python3.5/posixpath.py", line 361, in abspath
OSError: [Errno 24] Too many open files
ERROR: Internal Python error in the inspect module.
Below is the traceback from this internal error.
Unfortunately, your original traceback can not be constructed.
我完全不知道这意味着什么所以我自然而然地采取了尝试使用完全不同的词云库的“简单”行动方案。这是我遇到'wordcloud'的地方。有趣的是,当我尝试导入这个模块时,我得到了几乎相同的错误 - 我是否错误地安装了库?或者什么?
非常感谢任何帮助!
由于