pydotのdot_parserエラー

Couldn't import dot_parser, loading of dot files will not be possible.

というエラーが出る場合は、/usr/local/lib/python2.7/dist-packages/dot_parser.pyとかのdot_parser.pyを

$ diff -ub dot_parser.py.orig dot_parser.py
--- dot_parser.py.orig	2014-12-20 21:21:51.864889677 +0900
+++ dot_parser.py	2014-12-20 21:22:15.938683519 +0900
@@ -23,8 +23,9 @@
 from pyparsing import ( nestedExpr, Literal, CaselessLiteral, Word, Upcase, OneOrMore, ZeroOrMore,
     Forward, NotAny, delimitedList, oneOf, Group, Optional, Combine, alphas, nums,
     restOfLine, cStyleComment, nums, alphanums, printables, empty, quotedString,
-    ParseException, ParseResults, CharsNotIn, _noncomma, dblQuotedString, QuotedString, ParserElement )
+    ParseException, ParseResults, CharsNotIn, dblQuotedString, QuotedString, ParserElement )
 
+_noncomma = "".join( [ c for c in printables if c != "," ] )
 
 
 class P_AttrList:

という感じで修正しておく。

カテゴリー: Python パーマリンク

コメントを残す

メールアドレスが公開されることはありません。

Time limit is exhausted. Please reload the CAPTCHA.