Advertisement

关于pyecharts的报错信息:属性错误

阅读量:
复制代码
复制代码
    from pyecharts import Line
    

报错提示:系统提示无法导入Line模块

ImportError: 无法从pyecharts中导入名称为'line'的模块

当前版本已更新至1.9, 新版pyecharts在功能设计上进行了诸多调整,例如原先用于修改变量的指令现已发生变动

通过使用from pyecharts.charts import Line这一方式即可实现问题的解决

复制代码
    line = Line('标题')
    

若使用的是早期版本, 在执行过程中出现错误提示:AttributeError: str object has no attribute get

处理方式 :可将此处的‘标题’参数删除,不再传递标题信息。建议参考最新版本的相关指令进行学习。

此外,还有一种应对方案:安装旧版软件包pip install pyecharts==0.1.9.5

重新导入模块

复制代码
    from pyecharts import Line
    

系统稳定运行

参考:[关于AttributeError: str object has no attribute get的解决方法_佑佑有话说

全部评论 (0)

还没有任何评论哟~