我正在尝试在Plotly
上运行PyCharm
。以下代码不起作用:
import plotly.graph_objects as go
fig = go.Figure(
data=[go.Bar(y=[2, 1, 3])],
layout_title_text="A Figure Displayed with fig.show()"
)
fig.show()
但这可以在我同事的笔记本电脑上使用。当他运行代码时,该图将显示在浏览器上,其地址为127.0.0.1:some_port
他为什么可以跑步而我不能呢?是否可以在不使用脱机模式的情况下运行Plotly
图形(我可以使用plot
运行代码,但我更喜欢另一种方式,因为所有教程都使用在线模式)