Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Python-- Interface Test-- the solution to the error situation of using Times in xlwt Module

Shulou Source: shulou.com Published: 2022-06-03 03:17:47 10月03日 Update

When we do interface testing, we often use xlrd and xlwt modules, and the xlrd here is relatively easy to install.

But the xlwt installation will fail, download the xlwt3 module on the Internet and then use the python setup.py install instruction to

Install. When we import this module and use it, we will encounter the following two situations:

1. Error ValueError: cannot use LOCALE flag with a str pattern

Solution:

Go to Lib under the python3 installation directory, find the ser_parse.py file, and modify line 832

Comment this line and change it to:

If you run it again, you won't get it wrong.

2. Error ValueError: 'init' in slots conflicts with class variable

Solution:

Go to Lib\ site-packages\ xlwt3\ under the python3 installation directory and find the formula.py file and modify line 7

Change it to (remove init):

If you run it again, you won't get it wrong.

Tags: Module file scheme directory solution run situation interface test two code instruction time comment Laian method Times Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Linux Shulou Tech Info MariaDB Docker