把编码方式改成如下示例: with open('xxx.csv','a',newline='',encoding='utf_8_sig') as csvfile: 其他均不变 之后生成的csv文件就不会乱码啦:)