pip install pyyaml 问题

在window cmd下出现问题:安装报错如下:

Exception:

Traceback (most recent call last):
  File "d:\python\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 0xce in position 72: invalid
 continuation byte


During handling of the above exception, another exception occurred:


Traceback (most recent call last):
  File "d:\python\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "d:\python\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "d:\python\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "d:\python\lib\site-packages\pip\req\req_install.py", line 878, in instal
l
    spinner=spinner,
  File "d:\python\lib\site-packages\pip\utils\__init__.py", line 676, in call_su
bprocess
    line = console_to_str(proc.stdout.readline())
  File "d:\python\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 0xce in position 72: invalid

 continuation byte


原因:cmd字符编码问题:

解决办法:采用git bash的命令行(参见https://jingyan.baidu.com/article/ae97a646fb29ffbbfd461d1f.html)

在git bash 下使用pip install pyyaml 解决

你可能感兴趣的:(python使用)