解决方法:
修改Lib\site-packages\pip\compat 下的init文件第75行
return s.decode('utf_8')
改为
return s.decode('gbk')
*********************************************************************************************************
补充报错提示如下:
C:\Users\wsb>pip install pycocotools
Collecting pycocotools
Using cached https://files.pythonhosted.org/packages/75/5c/ac61ea715d7a89ecc31c090753bde28810238225ca8b71778dfe3e6a68bc/pycocotools-2.0.4.tar.gz
Requirement already satisfied: matplotlib>=2.1.0 in c:\users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages (from pycocotools)
Requirement already satisfied: numpy in c:\users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages (from pycocotools)
Requirement already satisfied: cycler>=0.10 in c:\users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages (from matplotlib>=2.1.0->pycocotools)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages (from matplotlib>=2.1.0->pycocotools)
Requirement already satisfied: pillow>=6.2.0 in c:\users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages (from matplotlib>=2.1.0->pycocotools)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages (from matplotlib>=2.1.0->pycocotools)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in c:\users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages (from matplotlib>=2.1.0->pycocotools)
Requirement already satisfied: six>=1.5 in c:\users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages (from python-dateutil>=2.1->matplotlib>=2.1.0->pycocotools)
Building wheels for collected packages: pycocotools
Running setup.py bdist_wheel for pycocotools ... error
Failed building wheel for pycocotools
Running setup.py clean for pycocotools
Failed to build pycocotools
Installing collected packages: pycocotools
Running setup.py install for pycocotools ... error
Exception:
Traceback (most recent call last):
File "C:\Users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_str
return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 40: invalid start byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "C:\Users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "C:\Users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages\pip\req\req_install.py", line 878, in install
spinner=spinner,
File "C:\Users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess
line = console_to_str(proc.stdout.readline())
File "C:\Users\wsb\.conda\envs\dete2for_python3.6\lib\site-packages\pip\compat\__init__.py", line 75, in console_to_str
return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 40: invalid start byte
You are using pip version 21.3.1, however version 22.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.