注册 登录
  • 欢迎访问开心洋葱网站,在线教程,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站,欢迎加入开心洋葱 QQ群
  • 欢迎访问开心洋葱网站,手机也能访问哦~欢迎加入开心洋葱多维思维学习平台 QQ群
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏开心洋葱吧~~~~~~~~~~~~~!

UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xce in position 72:

python 开心洋葱 2298次浏览 已收录 0个评论 手机上查看

UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xce in position 72:

E:\CodeFile\Tensorflow\fast-neural-style-tensorflow>pip install pyyaml
Collecting pyyaml
Downloading http://mirrors.aliyun.com/pypi/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz (253kB)
100% |████████████████████████████████| 256kB 14kB/s
Building wheels for collected packages: pyyaml
Running setup.py bdist_wheel for pyyaml … error
Failed building wheel for pyyaml
Running setup.py clean for pyyaml
Failed to build pyyaml
Installing collected packages: pyyaml
Running setup.py install for pyyaml … error
Exception:
Traceback (most recent call last):
File "d:\pfiles\python36\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:\pfiles\python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "d:\pfiles\python36\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "d:\pfiles\python36\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "d:\pfiles\python36\lib\site-packages\pip\req\req_install.py", line 878, in install
spinner=spinner,
File "d:\pfiles\python36\lib\site-packages\pip\utils__init__.py", line 676, in call_subprocess
line = console_to_str(proc.stdout.readline())
File "d:\pfiles\python36\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 byt

解决方案

看起来是标准输出流的编码不对的缘故。使用chcp命令,更改代码页为65001(UTF-8)再执行pip安装命令即可。

另外提供一些chcp命令的参考:

chcp 65001 就是换成UTF-8代码页
chcp 936 可以换回默认的GBK
chcp 437 是美国英语


开心洋葱 , 版权所有丨如未注明 , 均为原创丨未经授权请勿修改 , 转载请注明UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xce in position 72:
喜欢 (0)
[开心洋葱]
分享 (0)
关于作者:
开心洋葱,开心洋葱头,水墨

您必须 登录 才能发表评论!