遇到这样的错误:本地cdn资源在jupyter-notebook中使用时在chrome/safari上有问题。它在使用 pyvis 库时出现。
net = Network(notebook=True)
net.add_nodes(
[1, 2, 3, 4, 5], # node ids
label=['Node #1', 'Node #2', 'Node #3', 'Node #4', 'Node #5'], # node labels
# node titles (display on mouse hover)
title=['Main node', 'Just node', 'Just node', 'Just node', 'Node with self-loop'],
color=['#d47415', '#22b512', '#42adf5', '#4a21b0', '#e627a9'] # node colors (HEX)
)
net.add_edges([(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (5, 1)])
net.show('graph.html')
Run Code Online (Sandbox Code Playgroud)
我尝试将浏览器切换到 dataspell