Open liujuanjuan1984 opened 4 years ago
修改1:
为什么这么改: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.ExcelWriter.html 官网示例
结果: 报错 NameError: name 'ExcelWriter' is not defined
修改2:
with pd.ExcelWriter(comms_file, engine='xlsxwriter') as writer:
移除 engine 相关设定。
结果: 依然报错 FileNotFoundError: [Errno 2] No such file or directory: './output/xuecn_comments_statistics_2019-09-17 10:42.xlsx'
修改3: 可能真的是文件夹的问题了。。
检查了下,导入时未添加当前绝对路径到sys参数中
把路径申明从相对路径改成绝对路径,即可。
囧rz
output_path = 'C:/Users/75801/python_side_projects/xuecn_data/output/'
output_path = './output/'
今天是周一,用 python 脚本跑 xue.cn 数据统计分析的脚本,并输出结果到 excel 时,遇到一个报错:
代码中有以下报错:![image](https://user-images.githubusercontent.com/31027645/64960615-35d84180-d8c6-11e9-8c4f-cf45223f488c.png)
Abstract class 'ExcelWriter' with abstract methods instantiatedpylint(abstract-class-instantiated)
这个报警,自从我用 ExcelWriter方法时,一直就有,之前未产生异常。不过这次却直接导致代码没能运行通过。
而在 jupyter lab中,该代码就能直接运行通过,并正确输出结果。
什么原因,尚需探究。先记录下。