Home > Mobile >  Python errors in command prompt
Python errors in command prompt

Time:12-07

I have a python script that use tasks to write to excel files.

The script runs fine nor problems at all but I have a lot of warnings when I run.

The questions are:

1.-That errors are from the PIP install applications or from the script?

2.-I need to update something in the python or the PIP?

I want to check because clearly it says in future will affect but I don't know if this is due the code development or installation files in my computer.

Thank you

These are the type of errors I receive:

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)

CodePudding user response:

xlwt engine is used by pandas for writing xls files. As warning are saying that in near future this will be removed from pandas lib and pandas will no longer be able to write xls files. They are telling you to use newer xlsx files. And for that you'll need openpyxl if you don't have it already.

For reading difference between xls and xlsx files: read this

For openpyxl: read this

  • Related