2017-07-11 72 views
0

我使用PIP和PIP 3和安裝的easy_install枕頭我得到了一個錯誤:PIP安裝枕「UTF-8」編解碼器不能解碼

$ Exception: 
Traceback (most recent call last): 
    File "c:\users\梁生珺\appdata\local\programs\python\python36-32\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 0xc1 in position 55: invalid start byte 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "c:\users\梁生珺\appdata\local\programs\python\python36-32\lib\site-  packages\pip\basecommand.py", line 215, in main 
    status = self.run(options, args) 
    File "c:\users\梁生珺\appdata\local\programs\python\python36-32\lib\site-packages\pip\commands\install.py", line 342, in run 
    prefix=options.prefix_path, 
    File "c:\users\梁生珺\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_set.py", line 784, in install 
    **kwargs 
    File "c:\users\梁生珺\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_install.py", line 878, in install 
spinner=spinner, 
    File "c:\users\梁生珺\appdata\local\programs\python\python36-32\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess 
    line = console_to_str(proc.stdout.readline()) 
    File "c:\users\梁生珺\appdata\local\programs\python\python36-32\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 0xc1 in position 55: invalid start byte 

我已經用easy_install的更新PIP和PIP 3。

我用pip install xxx.whl和pip安裝枕頭。

但它沒用。我不知道如何解決這個問題。非常感謝。

+0

什麼是完整的追蹤? –

+0

這應該可以解決你的問題: https://stackoverflow.com/questions/41906206/pip-unicodedecodeerror-utf8-codec-cant-decode-byte – brotherperes

+1

@tiagoperes可能是最好的標誌作爲一個副本,而不僅僅是一個評論 – DavidG

回答

0

在多個版本上有pip有幾個類似的問題。可悲的是沒有適當的解決辦法,其中大多數只是暫時的黑客。

您可以嘗試通過downloading the source code手動安裝枕頭並運行python setup.py

您還可以查看this github thread,建議將第75行的return s.decode('utf-8')替換爲return s.decode('cp936')這是簡體中文的字符編碼。

進一步閱讀

upgrading pip error UnicodeDecodeError: 'utf-8' codec can't decode byte

pip UnicodeDecodeError: 'utf8' codec can't decode byte

相關問題