在安装tensorflow时需要安装qt,但是报错了,内容如下:
ERROR conda.core.link:_execute_actions(330): An error occurred while installing package 'defaults::qt-5.6.2-vc14_3'. UnicodeDecodeError('utf-8', b'\xd2\xd1\xb8\xb4\xd6\xc6 1 \xb8\xf6\xce\xc4\xbc\xfe\xa1\xa3\r\n', 0, 1, 'invalid continuation byte') Attempting to roll back. UnicodeDecodeError('utf-8', b'\xd2\xd1\xb8\xb4\xd6\xc6 1 \xb8\xf6\xce\xc4\xbc\xfe\xa1\xa3\r\n', 0, 1, 'invalid continuation byte')
截图如下:
解决方案: 在目录:E:\Anaconda3\Lib\site-packages\conda\common下修改compat.py
添加下面的内容到compat.py中
import chardet def ensure_text_type(value): if isinstance(value, text_type): encoding = 'utf-8' else: encoding = chardet.detect(value).get('encoding') or 'utf-8' return value.decode(encoding) if hasattr(value, 'decode') else value
就可以解决报错的问题。
本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。
我来说两句