我使用pip、pip3和easy_install安装枕头,我得到了一个错误:
$ 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和pip3。
我使用pip安装xxx.whl和pip安装枕头。
但没有用。我不知道如何解决这个问题。非常感谢。
发布于 2017-07-11 09:41:04
pip在多个版本上也有几个类似的问题。遗憾的是,没有适当的解决办法,其中大多数只是暂时的黑客。
您可以尝试手动安装枕头,通过下载源代码并运行python setup.py。
您还可以查看这个github线程,它建议将第75行中的return s.decode('utf-8')替换为return s.decode('cp936'),这是简体中文的字符编码。
再读
https://stackoverflow.com/questions/45029846
复制相似问题