import xlsx,os
path="d:\\test"
files=os.listdir(path)
for txtfile in files:
xlsxFile = open(path+"\\"+txtfile.split(".")[0]+".csv",'w',newline='')
writer = xlsx.writer(xlsxFile)
xlsxRow = []
f = open(path+"\\"+txtfile,'r',encoding="gb2312")
for line in list(f)[1:]:
xlsxRow = line.split()
writer.writerow(xlsxRow)
f.close()
xlsxFile.close()
显示这个错误提示:ModuleNotFoundError: No module named 'xlsx'