-Network has modules that depend on the environment, and depending on the version, the function cannot be found and an error is thrown, so I decided to write a solution.
pip install networkx==2.3
I was able to avoid the error by executing and lowering the version.
Since I was able to confirm the operation on both ubuntu and window, it is considered to be a problem on the networkx side.
Since the stable version of networkx was released about half a year ago, if there is a big problem, it is thought that the stable version is returned to 2.3, so I thought there was an alternative function, but I couldn't find it.