我正试图为我的硕士论文代码绘制一张地图。到目前为止,我只是在尝试一个来自maps.ipynb的例子,所以我认为一切都应该正常工作。但是,当尝试使用"simple_plotly“函数时,会出现一个NameError。我怎样才能使它发挥作用?
这是我得到错误的行:
from pandapower.plotting.plotly import simple_plotly
from pandapower.networks import mv_oberrhein
net = mv_oberrhein()
simple_plotly(net, on_map=True, projection='epsg:31467')错误
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-8-9381f16ca1ad> in <module>()
9
10 net = mv_oberrhein()
---> 11 simple_plotly(net, on_map=True, projection='epsg:31467')
~/miniconda3/lib/python3.6/site-packages/pandapower/plotting/plotly/simple_plotly.py in simple_plotly(net, respect_switches, use_line_geodata, on_map, projection, map_style, figsize, aspectratio, line_width, bus_size, ext_grid_size, bus_color, line_color, trafo_color, ext_grid_color)
116 **ext_grid_color** (String, 'yellow') - External Grid Color. Init is yellow
117 """
--> 118 version_check()
119 # create geocoord if none are available
120 if 'line_geodata' not in net:
~/miniconda3/lib/python3.6/site-packages/pandapower/plotting/plotly/traces.py in version_check()
33
34 def version_check():
---> 35 if version.parse(plotly_version) < version.parse("3.1.1"):
36 raise UserWarning("Your plotly version {} is no longer supported.\r\n"
37 "Please upgrade your python-plotly installation, "
NameError: name 'plotly_version' is not defined发布于 2019-07-07 10:40:14
发生此错误是因为没有巧妙地安装,请使用pip安装ploty,它将工作。
Pip install plotlyhttps://stackoverflow.com/questions/56869806
复制相似问题