繁体   English   中英

命令提示符中出现 Python 错误

[英]Python errors in command prompt

我有一个 python 脚本,它使用任务写入 excel 个文件。

该脚本运行良好,也没有任何问题,但我在运行时收到了很多警告。

问题是:

1.-错误来自 PIP 安装应用程序或脚本?

2.-我需要更新 python 或 PIP 中的内容吗?

我想检查一下,因为它明确表示将来会影响,但我不知道这是由于我的计算机中的代码开发还是安装文件引起的。

谢谢

这些是我收到的错误类型:

C:\asg\conversor\main.py:101: FutureWarning: As the xlwt package is no longer maintained, the xlwt engine will be removed in a future version of pandas. This is the only engine in pandas that supports writing in the xls format. Install openpyxl and write to an xlsx file instead. You can set the option io.excel.xls.writer to 'xlwt' to silence this warning. While this option is deprecated and will also raise a warning, it can be globally set and the warning suppressed.
  df.to_excel(dst[:-1], index=False, header=None)
sys:1: FutureWarning: In a future version of pandas all arguments of read_csv except for the argument 'filepath_or_buffer' will be keyword-only.
C:\asg\conversor\main.py:101: FutureWarning: As the xlwt package is no longer maintained, the xlwt engine will be removed in a future version of pandas. This is the only engine in pandas that supports writing in the xls format. Install openpyxl and write to an xlsx file instead. You can set the option io.excel.xls.writer to 'xlwt' to silence this warning. While this option is deprecated and will also raise a warning, it can be globally set and the warning suppressed.
  df.to_excel(dst[:-1], index=False, header=None)
sys:1: FutureWarning: In a future version of pandas all arguments of read_csv except for the argument 'filepath_or_buffer' will be keyword-only.
C:\asg\conversor\main.py:101: FutureWarning: As the xlwt package is no longer maintained, the xlwt engine will be removed in a future version of pandas. This is the only engine in pandas that supports writing in the xls format. Install openpyxl and write to an xlsx file instead. You can set the option io.excel.xls.writer to 'xlwt' to silence this warning. While this option is deprecated and will also raise a warning, it can be globally set and the warning suppressed.
  df.to_excel(dst[:-1], index=False, header=None)
sys:1: FutureWarning: In a future version of pandas all arguments of read_csv except for the argument 'filepath_or_buffer' will be keyword-only.
C:\asg\conversor\main.py:101: FutureWarning: As the xlwt package is no longer maintained, the xlwt engine will be removed in a future version of pandas. This is the only engine in pandas that supports writing in the xls format. Install openpyxl and write to an xlsx file instead. You can set the option io.excel.xls.writer to 'xlwt' to silence this warning. While this option is deprecated and will also raise a warning, it can be globally set and the warning suppressed.
  df.to_excel(dst[:-1], index=False, header=None)

xlwt enginepandas用于编写xls文件。 正如警告所说,在不久的将来,这将从pandas库中删除, pandas将不再能够写入xls文件。 他们告诉您使用更新的xlsx文件。 为此,如果您还没有openpyxl ,则需要它。

要阅读xlsxlsx文件之间的差异:请阅读此内容

对于openpyxl阅读这个

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM