报错:AttributeError: module ‘contourpy‘ has no attribute ‘contour_generator‘

背景:

最近在使用matplot绘制等高线时,使用以下语句时,

plt.contourf(xx, yy, z,alpha=0.2) # 透明度alpha=0.2

一直报错,一直提示AttributeError: module 'contourpy' has no attribute 'contour_generator'。

解决办法:

卸载掉contourpy模块,可以使用以下命令:

pip uninstall contourpy

再重新安装contourpy模块,-i后面是清华的pip 源

 pip install contourpy -i https://pypi.tuna.tsinghua.edu.cn/simple/

或者直接升级contourpy模块,这个作者未尝试,成功的可以在评论区留言。

你可能感兴趣的:(深度学习,python,开发语言,matplotlib)