When I tried using the model.identify_effect()
in the python dowhy library, I receive the above error. This occurs even if I use the examples provided in the Getting Started guide.
ChatGpt informs me that this is "due to the fact that dowhy internally uses networkx.algorithms.d_separated, which was removed or moved in recent versions of NetworkX (≥3.x)" and that the only current fix is to downgrade networkx to v. 2.8.
I tried it and it did work but it seems like a sub-optimal solution. Am I missing something? Is there a more elegant solution? I do see this issue on Github but it does not tell me much.
System: Ubuntu 22.04
Python: 3.11
networkx: 3.5 (downgraded to 2.8)
dowhy: 0.12
You can change the networkx package, on the fly, before loading dowhy:
# change in networkx 3.*, incompatible with dowhy 0.12; TODO: remove this when dowhy>0.12 is available
nx.algorithms.d_separated = nx.algorithms.d_separation.is_d_separator
nx.d_separated = nx.algorithms.d_separation.is_d_separator
from dowhy import CausalModel