After pip3 install, the error 'gbk' codec can't decode byte 0xa6 in position 480: illegal multibyte sequence is reported.

The error is reported as follows:

pip3 install -r requirements.txt
ERROR: Exception:
Traceback (most recent call last):
  File "d:\ProgramData\Anaconda3\envs\langchain-chatglm\lib\site-packages\pip\_internal\cli\base_command.py", line 169, in exc_logging_wrapper
    status = run_func(*args)
  File "d:\ProgramData\Anaconda3\envs\langchain-chatglm\lib\site-packages\pip\_internal\cli\req_command.py", line 248, in wrapper
    return func(self, options, args)
  File "d:\ProgramData\Anaconda3\envs\langchain-chatglm\lib\site-packages\pip\_internal\commands\install.py", line 342, in run
    reqs = self.get_requirements(args, options, finder, session)
  File "d:\ProgramData\Anaconda3\envs\langchain-chatglm\lib\site-packages\pip\_internal\cli\req_command.py", line 433, in get_requirements
    for parsed_req in parse_requirements(
  File "d:\ProgramData\Anaconda3\envs\langchain-chatglm\lib\site-packages\pip\_internal\req\req_file.py", line 148, in parse_requirements

 Solution:

The default encoding of Python's open method depends on the platform. If it is a Windows platform, the default encoding is gbk. If the file is utf-8 encoded, this error will be reported.

Just save the file as ansi code.

Guess you like

Origin blog.csdn.net/cangqiongxiaoye/article/details/131860181