in pyvis I always get this error: "AttributeError: 'NoneType' object has no attribute 'render'"

in pyvis I always get this error: "AttributeError: 'NoneType' object has no attribute 'render'"

Solution

When initializing the Network, I added notebook=True, this fixed the issue for me. The new code is:

from pyvis import network as net
import networkx as nx

#%%
g=net.Network(notebook=True)
nxg = nx.complete_graph(5)
g.from_nx(nxg)

#%%
g.show("example.html")

 

posted @ 2023-04-17 16:48  ChuckLu  阅读(789)  评论(0编辑  收藏  举报