pyecharts import Bar后找不到Bar,或报错AttributeError: 'str' object has no attribute 'get'

代码示例:

from pyecharts import Bar
bar =Bar("我的第一个图表", "这里是副标题")
bar.add("服装", ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"], [5, 20, 36, 10, 75, 90])
bar.show_config()
bar.render()

1. 使用from pyecharts import Bar 报错Bar不存在

2. 使用from pyecharts.charts.basic_charts import Bar 报错 AttributeError: 'str' object has no attribute 'get'

总结:

这是pyecharts版本问题,直接下载是最新版本,新旧使用方法不一样,下载旧版本即可,下载pyecharts的旧版本,0.1.9.5

pip install pyecharts==0.1.9.5

 

posted @ 2021-07-01 10:50  Mr_Wmn  阅读(1503)  评论(0编辑  收藏  举报