简体   繁体   English

升级pip时出错:UnicodeDecodeError:'utf-8'编解码器无法解码字节

[英]Error while upgrading pip: UnicodeDecodeError: 'utf-8' codec can't decode byte

I've just installed python on windows 10, and I'm trying to upgrade pip. 我刚刚在Windows 10上安装了python,我正在尝试升级pip。

My windows user name has hebrew charecters... 我的Windows用户名有希伯来字符...

When I try to run: 当我尝试运行时:

python -m pip install --upgrade pip

I get this error: 我收到此错误:

Collecting pip
Using cached pip-8.0.2-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 7.1.2
Exception:
Traceback (most recent call last):
  File "C:\Users\עדי\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\basecommand.py", line 211, in main
    status = self.run(options, args)
  File "C:\Users\עדי\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\commands\install.py", line 311, in run
    root=options.root_path,
  File "C:\Users\עדי\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\req\req_set.py", line 640, in install
    requirement.uninstall(auto_confirm=True)
  File "C:\Users\עדי\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\req\req_install.py", line 673, in uninstall
    for path in pip.wheel.uninstallation_paths(dist):
  File "C:\Users\עדי\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\wheel.py", line 512, in unique
    for item in fn(*args, **kw):
  File "C:\Users\עדי\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\wheel.py", line 531, in uninstallation_paths
    r = csv.reader(FakeFile(dist.get_metadata_lines('RECORD')))
  File "C:\Users\עדי\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1619, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "C:\Users\עדי\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1616, in get_metadata
    return self._get(self._fn(self.egg_info, name)).decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf2 in position 22365: invalid continuation byte
You are using pip version 7.1.2, however version 8.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

I'm geussing this has to do with my Hebrew windows user name, Is that correct? 我认为这与我的希伯来语用户名有关,这是正确的吗?

Can I upgrade pip without opening a new windows user? 我可以在不打开新用户的情况下升级pip吗?

It looks like a bug in pip where it's assuming its metadata is stored as UTF-8. 它看起来像是pip中的一个错误,它假设其元数据存储为UTF-8。 Instead, your username appears to be encoded as "windows-1255". 相反,您的用户名似乎被编码为“windows-1255”。

You could try the following: 您可以尝试以下方法:

  1. Backup C:\\Users\\עדי\\AppData\\Local\\Programs\\Python\\Python35-32\\lib\\site-packages\\pip\\_vendor\\pkg_resources\\__init__.py 备份C:\\Users\\עדי\\AppData\\Local\\Programs\\Python\\Python35-32\\lib\\site-packages\\pip\\_vendor\\pkg_resources\\__init__.py
  2. Goto line: 1616 转到行:1616
  3. Change utf-8 to mbcs . utf-8更改为mbcs
  4. Re-run upgrade 重新运行升级

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 UnicodeDecodeError: 'utf-8' 编解码器无法解码字节错误 - UnicodeDecodeError: 'utf-8' codec can't decode byte error pip install&UnicodeDecodeError:'utf-8'编解码器无法解码位置9的字节0xe0:无效的连续字节 - pip install & UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 9: invalid continuation byte UnicodeDecodeError:“ utf-8”编解码器无法解码字节(python) - UnicodeDecodeError: 'utf-8' codec can't decode byte (python) UnicodeDecodeError: 'utf-8' 编解码器无法解码字节 0xe0 - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 UnicodeDecodeError: 'utf-8' 编解码器无法解码字节 - UnicodeDecodeError: 'utf-8' codec can't decode byte Python UnicodeDecodeError: 'utf-8' 编解码器无法解码字节 - Python UnicodeDecodeError: 'utf-8' codec can't decode byte UnicodeDecodeError:'utf-8'编解码器无法解码 position 0 中的字节 0xff:读取 csv 时 python 中的无效起始字节错误 - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte error in python while reading a csv file pip UnicodeDecodeError: 'utf8' 编解码器无法解码字节 - pip UnicodeDecodeError: 'utf8' codec can't decode byte 套接字错误:“UnicodeDecodeError:‘utf-8’编解码器无法解码 position 中的字节 0xff 0:起始字节无效” - Socket error: "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte" 错误 UnicodeDecodeError:'utf-8' 编解码器无法解码 position 中的字节 0xff 0:起始字节无效 - error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM