victorlei/smop

error on notebook 'DiGraph' object has no attribute 'node'

enaeini opened this issue · 3 comments

I get this error. Any thoughts please to help?

WARNING: Couldn't open 'parser.out'. [Errno 20] Not a directory: '/usr/local/lib/python3.6/dist-packages/smop-0.41b0-py3.6.egg/smop/parser.out'
WARNING: Token 'CLASSDEF' defined, but not used
WARNING: Token 'END_UNEXPECTED' defined, but not used
WARNING: There are 2 unused tokens
Generating LALR tables
WARNING: Couldn't create 'parsetab'. [Errno 20] Not a directory: '/usr/local/lib/python3.6/dist-packages/smop-0.41b0-py3.6.egg/smop/parsetab.py'
str
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/smop-0.41b0-py3.6.egg/smop/main.py", line 66, in main
G = resolve.resolve(stmt_list)
File "/usr/local/lib/python3.6/dist-packages/smop-0.41b0-py3.6.egg/smop/resolve.py", line 54, in resolve
u = G.node[n]["ident"]
AttributeError: 'DiGraph' object has no attribute 'node'
Errors: 1

oryba commented

An easy fix would be pip install networkx==1.11. Just faced the same issue and this workaround helped. Networkx v2 is somewhat non-backward compatible with the version used here

G.node needs to be changed to G.nodes in two places in resolve.py. This is due to a change in networkx, as mentioned by oryba.
see dgorissen/pycel#80

Duplicating #165