Fix bug in networkx1.11 + graphviz on OS X #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When run with a simple AMR input, I get:
Traceback (most recent call last):
File "./disagree.py", line 317, in
monolingual_main(args)
File "./disagree.py", line 199, in monolingual_main
ag = nx.to_agraph(g)
AttributeError: 'module' object has no attribute 'to_agraph'
This seems to be caused by a bug "in the
draw_graphviz
function innetworkx-1.11 triggered by the change that the graphviz drawing tools
are no longer imported into the top level namespace of networkx"
See: https://stackoverflow.com/a/35280794/800207
This commit fixese the issue by replacing direct
nx.to_agraph()
callwith appropriate full path calls.
I tried reproducing the error on Ubuntu but did not succeed.
I am creating this PR in case somebody else faces similar issue.