看似正确的 Graphviz 源在渲染时会产生错误

看似正确的 Graphviz 源在渲染时会产生错误

我遇到了一个特殊的情况。我在两个环境中安装了两个版本的 Graphviz:2.44.1Windows 和2.40.1Debian。我生成的图表在两者上生成相同的源,但它在 Debian 上的渲染失败Syntax error on line 37 near [

据我所知,我按照应有的方式配置了 Linux 环境,安装了软件包并运行sudo dot -c.所以我认为有两件事可能有问题:要么文件不正确,要么是新版本中已修复的错误。然而我无法验证第二个假设,因为变更日志极其最新更新后简洁。但是我可以测试第一个,至少是间接测试。 Debian 环境位于我的“适用于 Linux 的 Windows 子系统”上,因此我能够将文件复制到我的 Windows 文件系统,以验证是否可以使用较新的版本呈现相同的文件。所以这表明它可能是版本问题。此外,该文件不包含任何杂散特殊字符,已通过 Notepad++ 手动检查验证。

我尝试了两件事:1)寻找更新的软件包 - 它在 Python 的 Conda 或 Debian 向后移植中不存在(这是我所知的范围),2)从来源。但我在Linux上构建源码包的经验很少,所以我失败了。该png格式无法识别,从我收集的信息来看,这是一些依赖性问题。需求中列出的一些库(如 zlib)也不在 Debian 存储库中,所以我再次不知所措。

我知道这个问题并不完全适合 Stack Exchange,但我想我已经广泛地演示了我在调试这个问题时所尝试的方法,但仍然一无所获。我还不想打扰维护人员,所以我决定在这里碰碰运气。我非常感谢您回答以下任一问题。

  • 一般来说,是否有其他直接的方法来安装更新版本的软件包,或者特别是 Graphviz 软件包?
  • 具有 Graphviz 环境的其他人是否可以验证以下源文件是否产生像我描述的错误或成功编译?它是用dot -Kdot -Tpng -O source.
digraph  {
__author__ [fillcolor="#E5E5E5", label=" __author__ \nV:22", shape=box, style=filled];
__version__ [fillcolor="#E5E5E5", label="__version__ \nV:23", shape=box, style=filled];
__license__ [fillcolor="#E5E5E5", label="__license__ \nV:24", shape=box, style=filled];
PY3 [fillcolor="#E4FFE4", label="    PY3     \nV:27", shape=box, style=filled];
GRAPH_ATTRIBUTES [fillcolor="#E4FFE4", label="GRAPH_ATTRIBUTES\nV:34", shape=box, style=filled];
EDGE_ATTRIBUTES [fillcolor="#E4FFE4", label="EDGE_ATTRIBUTES\nV:52", shape=box, style=filled];
NODE_ATTRIBUTES [fillcolor="#E4FFE4", label="NODE_ATTRIBUTES\nV:66", shape=box, style=filled];
CLUSTER_ATTRIBUTES [fillcolor="#E4FFE4", label="CLUSTER_ATTRIBUTES\nV:77", shape=box, style=filled];
DEFAULT_PROGRAMS [fillcolor="#E4FFE4", label="DEFAULT_PROGRAMS\nV:83", shape=box, style=filled];
is_windows [fillcolor="#E4FFE4", label=" is_windows \nF:93", shape=ellipse, style=filled];
is_anaconda [fillcolor="#E4FFE4", label="is_anaconda \nF:98", shape=ellipse, style=filled];
get_executable_extension [fillcolor="#FFFFFF", label="get_executable_extension\nF:104", shape=ellipse, style=filled];
call_graphviz [fillcolor="#FFFFFF", label="call_graphviz\nF:112", shape=ellipse, style=filled];
frozendict [fillcolor="#FFFFFF", label=" frozendict \nC:152", shape=parallelogram, style=filled];
dot_keywords [fillcolor="#E4FFE4", label="dot_keywords\nV:202", shape=box, style=filled];
id_re_alpha_nums [fillcolor="#E4FFE4", label="id_re_alpha_nums\nV:204", shape=box, style=filled];
id_re_alpha_nums_with_ports [fillcolor="#E4FFE4", label="id_re_alpha_nums_with_ports\nV:205", shape=box, style=filled];
id_re_num [fillcolor="#E4FFE4", label=" id_re_num  \nV:207", shape=box, style=filled];
id_re_with_port [fillcolor="#E4FFE4", label="id_re_with_port\nV:208", shape=box, style=filled];
id_re_dbl_quoted [fillcolor="#E4FFE4", label="id_re_dbl_quoted\nV:209", shape=box, style=filled];
id_re_html [fillcolor="#E4FFE4", label=" id_re_html \nV:210", shape=box, style=filled];
needs_quotes [fillcolor="#FFE0E0", label="needs_quotes\nF:213", shape=ellipse, style=filled];
quote_if_necessary [fillcolor="#FFE0E0", label="quote_if_necessary\nF:249", shape=ellipse, style=filled];
graph_from_dot_data [fillcolor="#E4FFE4", label="graph_from_dot_data\nF:275", shape=ellipse, style=filled];
graph_from_dot_file [fillcolor="#BBEEFF", label="graph_from_dot_file\nF:287", shape=ellipse, style=filled];
graph_from_edges [fillcolor="#BBEEFF", label="graph_from_edges\nF:306", shape=ellipse, style=filled];
Dot [fillcolor="#FFE0E0", label="    Dot     \nC:1694", shape=parallelogram, style=filled];
Edge [fillcolor="#FFA0A0", label="    Edge    \nC:692", shape=parallelogram, style=filled];
graph_from_adjacency_matrix [fillcolor="#BBEEFF", label="graph_from_adjacency_matrix\nF:341", shape=ellipse, style=filled];
graph_from_incidence_matrix [fillcolor="#BBEEFF", label="graph_from_incidence_matrix\nF:378", shape=ellipse, style=filled];
Common [fillcolor="#E4FFE4", label="   Common   \nC:415", shape=parallelogram, style=filled];
Error [fillcolor="#E4FFE4", label="   Error    \nC:549", shape=parallelogram, style=filled];
InvocationException [fillcolor="#E5E5E5", label="InvocationException\nC:558", shape=parallelogram, style=filled];
Node [fillcolor="#FFE0E0", label="    Node    \nC:568", shape=parallelogram, style=filled];
Cluster [fillcolor="#FFE0E0", label="  Cluster   \nC:1639", shape=parallelogram, style=filled];
Subgraph [fillcolor="#FFFFFF", label="  Subgraph  \nC:1585", shape=parallelogram, style=filled];
Graph [fillcolor="#FFE0E0", label="   Graph    \nC:887", shape=parallelogram, style=filled];
get_executable_extension -> is_windows;
get_executable_extension -> is_anaconda;
call_graphviz -> get_executable_extension;
call_graphviz -> DEFAULT_PROGRAMS;
frozendict -> frozendict;
needs_quotes -> id_re_dbl_quoted;
needs_quotes -> needs_quotes;
needs_quotes -> dot_keywords;
needs_quotes -> id_re_alpha_nums_with_ports;
needs_quotes -> id_re_num;
needs_quotes -> id_re_alpha_nums;
needs_quotes -> id_re_html;
needs_quotes -> id_re_with_port;
quote_if_necessary -> needs_quotes;
graph_from_dot_file -> PY3;
graph_from_dot_file -> graph_from_dot_data;
graph_from_edges -> Dot;
graph_from_edges -> Edge;
Dot -> PY3;
Dot -> Graph;
Dot -> call_graphviz;
Edge -> quote_if_necessary;
Edge -> Cluster;
Edge -> Edge;
Edge -> PY3;
Edge -> Common;
Edge -> Subgraph;
Edge -> Node;
Edge -> frozendict;
Edge -> Error;
Edge -> EDGE_ATTRIBUTES;
graph_from_adjacency_matrix -> Dot;
graph_from_adjacency_matrix -> Edge;
graph_from_incidence_matrix -> Dot;
graph_from_incidence_matrix -> Edge;
Node -> quote_if_necessary;
Node -> Common;
Node -> NODE_ATTRIBUTES;
Cluster -> quote_if_necessary;
Cluster -> CLUSTER_ATTRIBUTES;
Cluster -> Graph;
Subgraph -> Graph;
Graph -> quote_if_necessary;
Graph -> Edge;
Graph -> Cluster;
Graph -> Common;
Graph -> Node;
Graph -> GRAPH_ATTRIBUTES;
Graph -> Error;
Graph -> Graph;
Graph -> Subgraph;
}

相关内容