一、cannot import name ‘Label‘ from ‘pandas._typing‘
执行下面的代码,报错:cannot import name 'Label' from 'pandas._typing'
import pandas as pd
path = '/content/drive/MyDrive/output.csv'
with open(path, 'w', encoding = 'utf-8-sig') as f:
df.to_csv(f)
网上有人说把安装pandas的1.2.0版本,有人说安装pandas的1.1.15版本,参考https://www.jianshu.com/p/5fb082ecd908,我试了一下,还是1.3.0版本靠谱,解决了问题
二、ImportError: cannot import name ‘_check_savefig_extra_args‘ from ‘matplotlib.backend_bases‘
参考下面的文章
出现以上问题的原因是matplotlib版本过高,将高版本的matplotlib卸载,安装低版本的matplotlib即可。
当前d2l包的版本是d2l 2.0.0b0,推荐使用安装matplotlib ==3.0.0 (版本查看可使用pip list命令)