Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report