日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Anaconda安装Tensorflow报错UnicodeDecodeError: 'utf-8' codec can't decode ## invalid start byte的问题之解决

發布時間:2023/12/20 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Anaconda安装Tensorflow报错UnicodeDecodeError: 'utf-8' codec can't decode ## invalid start byte的问题之解决 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

轉載請注明出處:http://blog.csdn.net/apply51/article/details/79516002

本人在使用Anaconda?prompt通過命令:

pip install --ignore-installed --upgrade tensorflow

安裝tensorflow時報錯:

Building wheels for collected packages: absl-py, gast, termcolor, html5libRunning setup.py bdist_wheel for absl-py ... errorFailed building wheel for absl-pyRunning setup.py clean for absl-pyRunning setup.py bdist_wheel for gast ... errorFailed building wheel for gastRunning setup.py clean for gastRunning setup.py bdist_wheel for termcolor ... errorFailed building wheel for termcolorRunning setup.py clean for termcolorRunning setup.py bdist_wheel for html5lib ... errorFailed building wheel for html5libRunning setup.py clean for html5lib Failed to build absl-py gast termcolor html5lib Installing collected packages: numpy, setuptools, six, protobuf, grpcio, werkzeug, markdown, wheel, html5lib, bleach, tensorboard, absl-py, astor, gast, termcolor, tensorflowRunning setup.py install for html5lib ... error Exception: Traceback (most recent call last):File "C:\DeepLearning\Anaconda3\envs\tensorflow\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_strreturn s.decode(sys.__stdout__.encoding) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc1 in position 45: invalid start byteDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "C:\DeepLearning\Anaconda3\envs\tensorflow\lib\site-packages\pip\basecommand.py", line 215, in mainstatus = self.run(options, args)File "C:\DeepLearning\Anaconda3\envs\tensorflow\lib\site-packages\pip\commands\install.py", line 342, in runprefix=options.prefix_path,File "C:\DeepLearning\Anaconda3\envs\tensorflow\lib\site-packages\pip\req\req_set.py", line 784, in install**kwargsFile "C:\DeepLearning\Anaconda3\envs\tensorflow\lib\site-packages\pip\req\req_install.py", line 878, in installspinner=spinner,File "C:\DeepLearning\Anaconda3\envs\tensorflow\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocessline = console_to_str(proc.stdout.readline())File "C:\DeepLearning\Anaconda3\envs\tensorflow\lib\site-packages\pip\compat\__init__.py", line 75, in console_to_strreturn s.decode('utf_8') UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc1 in position 45: invalid start byte

找了一大片的解決方案,有使用?Notepad++改編碼格式的,也有添加三條代碼的:

sys.getdefaultencoding() != 'gbk': reload(sys) sys.setdefaultencoding('gbk')

都不能解決我的問題,最后的解決辦法是,根據最后的報錯提示行:

File "C:\DeepLearning\Anaconda3\envs\tensorflow\lib\site-packages\pip\compat\__init__.py", line 75, in console_to_strreturn s.decode('utf_8')

找到__init__.py,使用Notepad++打開,將提示的第75行進行更改:

return s.decode(sys.__stdout__.encoding) 應改為 return s.decode('cp936')

更改__init__.py時記得備份一下,以備以后需要使用到原版。

折騰了一天,問題終于解決,開心并記錄之。

總結

以上是生活随笔為你收集整理的Anaconda安装Tensorflow报错UnicodeDecodeError: 'utf-8' codec can't decode ## invalid start byte的问题之解决的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。