[Solved] Error: ‘gbk’ codec can’t decode byte 0x98 in position

pip install -r requirements.txt. An error occurred while executing the command.

 File "D:\Program Files\lib\distutils\dist.py", line 395, in parse_config_files
    parser.read(filename)
  File "D:\Program Files\lib\configparser.py", line 697, in read
  File "D:\Program Files\lib\configparser.py", line 1015, in _read
    for lineno, line in enumerate(fp, start=1):
UnicodeDecodeError: 'gbk' codec can't decode byte 0x98 in position 1130: illegal multibyte sequence

The error reported is “can’t decode byte 0x98”

https://www.jianshu.com/p/04264d4761ef

This article also talks about solving “can’t decode byte 0x98”

The statement it gives is that Chinese appears in the file, and encoding=”UTF-8″ is added after open. Our problem is different from his, but since the same error is reported, try his method. According to the error file, locate the dist.py file.

turn up

parser.read(filename)

change to

parser.read(filename,encoding="UTF-8")

The problem is solved.

I don’t want to read the code, and I don’t understand the cause of the problem, so I record it in a confused way.