Python Plotly Sunburst-TypeError:Sunburst()得到一个意外的关键字参数';路径';

Python Plotly Sunburst-TypeError:Sunburst()得到一个意外的关键字参数';路径';,python,plotly,visualization,Python,Plotly,Visualization,我试图让Plotly的示例代码在jupyter笔记本中运行,用于“缺少值的矩形数据”。把他们网站上的代码一字不差地复制到jupyter笔记本上,我得到了下面的TypeError,有什么想法吗 TypeError: sunburst() got an unexpected keyword argument 'path' 代码: 您必须升级到plotlyversion 4.5.0,以便将新的path关键字参数升级到sunburst和treemap:)使用这些命令,它将运行 pip安装--有计划地升

我试图让Plotly的示例代码在jupyter笔记本中运行,用于“缺少值的矩形数据”。把他们网站上的代码一字不差地复制到jupyter笔记本上,我得到了下面的TypeError,有什么想法吗

TypeError: sunburst() got an unexpected keyword argument 'path'
代码:


您必须升级到
plotly
version 4.5.0,以便将新的
path
关键字参数升级到
sunburst
treemap
:)

使用这些命令,它将运行

pip安装--有计划地升级
!pip安装--有计划地升级

!pip install --upgrade plotly
工作正常。这是由于版本不兼容造成的。

执行此操作后,如果您使用内部代码编辑器,则必须重新启动内核

但是如果您使用像GOOGLE COLLAB之类的在线编辑器或任何您只需刷新浏览器的东西

#更新

如果您仍然有任何问题,请尝试此特定版本,而不是停留在它上面
!pip plotly安装==4.8.2

这是更好理解的代码

fig = px.sunburst(df1,
                  path =['CourseP','CourseS', 'Gender'],
                  title = "Complete overview of students with their course and year of college")
fig.show(renderer="colab")

我运行了这个代码
!pip install plotly==4.5.2
从我的笔记本中,然后我添加了
import plotly.express作为px df=px.data.tips()fig=px.sunburst(df,path=['sex',day','time',values='total_bill',color='time')fig.show()
但我仍然收到了相同的错误-->
sunburst()获取了一个意外的关键字参数“path”
安装后是否重新启动了内核?
fig = px.sunburst(df1,
                  path =['CourseP','CourseS', 'Gender'],
                  title = "Complete overview of students with their course and year of college")
fig.show(renderer="colab")