{"id":581,"date":"2017-05-23T21:42:24","date_gmt":"2017-05-23T13:42:24","guid":{"rendered":"http:\/\/blog.defjia.top\/?p=581"},"modified":"2017-05-23T21:42:24","modified_gmt":"2017-05-23T13:42:24","slug":"23rd-may-%e8%ae%b0%e5%bd%95%e5%9c%a8wordcloud%e5%ba%93%e7%9a%84%e5%ad%a6%e4%b9%a0%e8%bf%87%e7%a8%8b%e4%b8%ad%e7%9a%84%e5%90%84%e7%a7%8d%e5%9d%91","status":"publish","type":"post","link":"https:\/\/blog.defjia.top\/?p=581","title":{"rendered":"23rd May \u8bb0\u5f55\u5728wordcloud\u5e93\u7684\u5b66\u4e60\u8fc7\u7a0b\u4e2d\u7684\u5404\u79cd\u5751"},"content":{"rendered":"<p>\u4eca\u5929\u5728\u529e\u516c\u5ba4\u7ec8\u4e8e\u628awordcloud\u9879\u76ee\u7684\u524d\u534a\u90e8\u5206\uff0c\u5373\u6570\u636e\u51c6\u5907\u90e8\u5206\u3002<\/p>\n<p>\u8c03\u7528\u4e86\u719f\u6089\u7684pymysql\uff0c\u6b63\u5219re\u5e93\u5206\u89e3\u5355\u6761\u7684\u804a\u5929\u8bb0\u5f55\uff0c\u5177\u4f53\u8fc7\u7a0b\u7565\u53bb\u4e0d\u8868\u3002<\/p>\n<p>\u7740\u91cd\u8bb0\u5f55\u4e00\u4e0b\u9047\u5230\u7684\u5751\u4ee5\u53ca\u89e3\u51b3\u529e\u6cd5\u3002<\/p>\n<ol>\n<li>emoji\u8868\u60c5\u7684\u7f16\u7801\u95ee\u9898<br \/>\n\u5728\u5904\u7406\u6587\u672c\u7684\u8fc7\u7a0b\u4e2d\u518d\u6b21\u9047\u5230\u4e86\u8ba9\u4eba\u5934\u75bc\u7684\u7f16\u7801\u95ee\u9898\u2014\u2014Python\u62a5\u51fa\u4e86UnicodeDecodeError\u95ee\u9898\uff0c\u4f3c\u4e4e\u4e4b\u524d\u5c31\u9047\u5230\u8fc7\u4e00\u6b21\u3002<br \/>\n\u4f46\u662f\u6211\u5e76\u6ca1\u6709\u5b9e\u9645\u5730\u89e3\u51b3\u5b83\u4eec\uff0c\u6bd5\u7adf\u6f0f\u6389\u5c11\u91cf\u6837\u672c\u4e0d\u5f71\u54cd\u6700\u7ec8\u7ed3\u679c\uff0c\u4e8e\u662f\u4e4e\u6211\u5c31\u4f7f\u7528\u5f02\u5e38\u5904\u7406pass\u6389\u4e86\u6240\u6709\u7684UnicodeDecodeError\uff0c\u7136\u540e\u5c31\u6b63\u5e38\u5730\u904d\u5386\u4e86\u4e00\u904d\uff0c\u5341\u5206\u7406\u60f3\u3002<\/li>\n<li>\u81ea\u5df1\u4f5c\u6b7b\u81f4\u4f7fwordcloud\u5e93\u65e0\u6cd5\u6b63\u5e38import<br \/>\n\u5728\u5bfc\u5165WordCloud\u8fd9\u4e2aModule\u7684\u65f6\u5019\u603b\u662f\u627e\u4e0d\u5230\uff0c\u540e\u6765\u767e\u601d\u4e0d\u5f97\u5176\u89e3\u7684\u65f6\u5019\u770b\u4e86\u4e00\u4e2a\u77e5\u4e4e\u56de\u7b54\u2014\u2014<a href=\"https:\/\/www.zhihu.com\/question\/49954899\/answer\/145388110\" target=\"_blank\"  rel=\"nofollow\" >\u201c\u6700\u540e\u6211\u53d1\u73b0\u6211\u7684\u6d4b\u8bd5\u6587\u6863\u547d\u540d\u4e3a\u2018wordcloud.py\u2019\u201d<\/a>\uff0c\u7a81\u7136\u9192\u609f\uff0c\u771f\u662fzz\u4e00\u822c\u3002<\/li>\n<li>Pillow\u5e93\u7684\u9519\u8bef\u5f15\u53d1\u7684\u5f02\u5e38<br \/>\n<code>from . import _imaging as core<br \/>\nImportError: DLL load failed: \u627e\u4e0d\u5230\u6307\u5b9a\u7684\u7a0b\u5e8f\u3002<br \/>\nraise ImportError(\"The _imaging extension was built for another \"<br \/>\nImportError: The _imaging extension was built for another version of Pillow or PIL<\/code><br \/>\n\u7136\u540e\u80fd\u5bfc\u5165WordCloud\u4e86\uff0c\u63a5\u7740\u53c8\u51fa\u73b0\u4e86\u4ee5\u4e0a\u7684\u95ee\u9898\uff0c\u5927\u6982\u662fPillow\u5e93\u6ca1\u88c5\u5bf9\uff0c\u91cd\u65b0\u88c5\u4e86\u4e00\u904d\uff0c\u5c31\u53d8\u597d\u4e86\uff0c\u63a5\u7740\u8fdb\u5165\u4e0b\u4e00\u4e2a\u5751\u3002<\/li>\n<li>color_from_image.py\u4e22\u5931\u95ee\u9898<br \/>\n<code>from .color_from_image import ImageColorGenerator<br \/>\nModuleNotFoundError: No module named 'wordcloud.color_from_image'<\/code><br \/>\n\u5728Google\u548cBaidu\u641c\u4e86\u534a\u5929\uff0c\u6709\u7c7b\u4f3c\u7684\u95ee\u9898\u4f46\u90fd\u6ca1\u6709\u5f88\u597d\u89e3\u51b3\u6211\u7684\u9519\u8bef\uff0c\u5728Github\u7684issues\u4e13\u680f\u770b\u5230\u51e0\u4e4e\u6bcf\u4e00\u4e2awordcloud\u7684\u95ee\u9898Amueller(\u4f3c\u4e4e\u662f\u5199wordcloud\u7684\u4eba)\u90fd\u6709\u5f88\u8ba4\u771f\u7684\u56de\u7b54\uff0c\u867d\u7136\u5e76\u6ca1\u6709\u89e3\u51b3\u6211\u7684\u95ee\u9898\u3002\u540e\u6765\u5c31\u5f53\u6211\u51c6\u5907\u653e\u5f03\u7684\u65f6\u5019\u6211\u627e\u5230packages-site\u8fd9\u4e2a\u6587\u4ef6\u5939\u627e\u5230wordcloud\u5e93\u6240\u5728\u4f4d\u7f6e\uff0c\u5bf9\u7167\u4e86\u4e00\u4e0bAmueller\u7684Github\u2014\u2014<a href=\"https:\/\/github.com\/amueller\/word_cloud\/blob\/master\/wordcloud\/color_from_image.py\" target=\"_blank\"  rel=\"nofollow\" >word_cloud\/color_from_image.py at master \u00b7 amueller\/word_cloud<\/a>\uff0c\u53d1\u73b0\u786e\u5b9e\u5c11\u4e86color_from_image.py\uff0c\u628a\u6e90\u7801\u590d\u5236\u4e0b\u6765\uff0c\u4fdd\u5b58\uff0c\u5c45\u7136\u6210\u529f\u4e86\uff01<\/li>\n<li>\u7f3a\u5c11\u5b57\u4f53\u6587\u4ef6\u95ee\u9898<br \/>\n\u5927\u6982\u5c31\u662f\u7f3a\u5c11\u4e00\u4e2a.ttf\u7684\u5b57\u4f53\u6587\u4ef6\uff0c\u968f\u4fbf\u4e0b\u4e86\u4e00\u4e2a\u653e\u5728\u4e86\u5bf9\u5e94\u76ee\u5f55\uff0c\u56e0\u4e3a\u6709\u9700\u8981\u4e2d\u6587\u5b57\u5e93\u3002\u7136\u540e\u5c31\u771f\u7684\u8dd1\u4e86\u51fa\u6765\uff0c\u5b8c\u7f8e\uff01<\/li>\n<\/ol>\n<p>\u6162\u6162\u8865\uff0c\u603b\u4e4b\u4ece\u4e00\u4e2a\u4e2a\u5751\u4e2d\u8df3\u51fa\u6765\u662f\u5f88\u56f0\u96be\u7684\uff0c\u4f46\u662f\u6700\u7ec8test.py\u6b63\u786e\u8fd0\u884c\u4e0d\u62a5\u9519\u65f6\u7684\u611f\u89c9\u5b9e\u5728\u662f\u592a\u723d\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u5728\u529e\u516c\u5ba4\u7ec8\u4e8e\u628awordcloud\u9879\u76ee\u7684\u524d\u534a\u90e8\u5206\uff0c\u5373\u6570\u636e\u51c6\u5907\u90e8\u5206\u3002 \u8c03\u7528\u4e86\u719f\u6089\u7684pymysql\uff0c\u6b63\u5219re\u5e93\u5206\u89e3\u5355\u6761\u7684\u804a\u5929\u8bb0\u5f55\uff0c\u5177\u4f53\u8fc7\u7a0b\u7565\u53bb\u4e0d\u8868\u3002 \u7740\u91cd\u8bb0\u5f55\u4e00\u4e0b\u9047\u5230\u7684\u5751\u4ee5\u53ca\u89e3\u51b3\u529e\u6cd5\u3002 emoji\u8868\u60c5\u7684\u7f16\u7801\u95ee\u9898 \u5728\u5904\u7406\u6587\u672c\u7684\u8fc7\u7a0b\u4e2d\u518d\u6b21\u9047\u5230\u4e86\u8ba9\u4eba\u5934\u75bc\u7684\u7f16\u7801\u95ee\u9898\u2014\u2014Python\u62a5\u51fa\u4e86UnicodeDecodeError\u95ee\u9898\uff0c\u4f3c\u4e4e\u4e4b\u524d\u5c31\u9047\u5230\u8fc7\u4e00\u6b21\u2026\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-581","post","type-post","status-publish","format-standard","hentry","category-3"],"_links":{"self":[{"href":"https:\/\/blog.defjia.top\/index.php?rest_route=\/wp\/v2\/posts\/581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.defjia.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.defjia.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.defjia.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.defjia.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=581"}],"version-history":[{"count":0,"href":"https:\/\/blog.defjia.top\/index.php?rest_route=\/wp\/v2\/posts\/581\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.defjia.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.defjia.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.defjia.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}