升级 pip 时出错:UnicodeDecodeError: 'utf

编程入门 行业动态 更新时间:2024-10-24 12:22:37
本文介绍了升级 pip 时出错:UnicodeDecodeError: 'utf-8' codec can't decode byte的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在 Windows 10 上安装了 python,我正在尝试升级 pip.

I've just installed python on windows 10, and I'm trying to upgrade pip.

我的 windows 用户名有希伯来语字符...

当我尝试运行时:

python -m pip install --upgrade pip

我收到此错误:

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עדיAppDataLocalProgramsPythonPython35-32libsite-packagespipasecommand.py", line 211, in main
    status = self.run(options, args)
  File "C:UsersעדיAppDataLocalProgramsPythonPython35-32libsite-packagespipcommandsinstall.py", line 311, in run
    root=options.root_path,
  File "C:UsersעדיAppDataLocalProgramsPythonPython35-32libsite-packagespipeqeq_set.py", line 640, in install
    requirement.uninstall(auto_confirm=True)
  File "C:UsersעדיAppDataLocalProgramsPythonPython35-32libsite-packagespipeqeq_install.py", line 673, in uninstall
    for path in pip.wheel.uninstallation_paths(dist):
  File "C:UsersעדיAppDataLocalProgramsPythonPython35-32libsite-packagespipwheel.py", line 512, in unique
    for item in fn(*args, **kw):
  File "C:UsersעדיAppDataLocalProgramsPythonPython35-32libsite-packagespipwheel.py", line 531, in uninstallation_paths
    r = csv.reader(FakeFile(dist.get_metadata_lines('RECORD')))
  File "C:UsersעדיAppDataLocalProgramsPythonPython35-32libsite-packagespip\_vendorpkg_resources\__init__.py", line 1619, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "C:UsersעדיAppDataLocalProgramsPythonPython35-32libsite-packagespip\_vendorpkg_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.

我猜这与我的希伯来语 windows 用户名有关,对吗?

I'm geussing this has to do with my Hebrew windows user name, Is that correct?

我可以在不打开新 Windows 用户的情况下升级 pip 吗?

Can I upgrade pip without opening a new windows user?

推荐答案

它看起来像是 pip 中的一个错误,它假设其元数据存储为 UTF-8.相反,您的用户名似乎编码为windows-1255".

It looks like a bug in pip where it's assuming its metadata is stored as UTF-8. Instead, your username appears to be encoded as "windows-1255".

您可以尝试以下操作:

备份C:UsersעדיAppDataLocalProgramsPythonPython35-32libsite-packagespip\_vendorpkg_resources\__init__.py转到行:1616将 utf-8 更改为 mbcs.重新运行升级

这篇关于升级 pip 时出错:UnicodeDecodeError: 'utf-8' codec can't decode byte的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-03-29 04:15:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/747770.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:UnicodeDecodeError   pip   utf

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!