在virtualenv中使用pip安装时出现UnicodeDecodeError

时间:2019-05-29 22:13:05

标签: python unicode utf-8 virtualenv decode

我正在虚拟环境中安装Nucypher,并获得std::any,如下所示:

命令:

UnicodeDecodeError

输出:

python -m pip install nucypher

我正在使用Windows 10,pip 19.1.1。 在同一虚拟环境中安装ERROR: Exception: Traceback (most recent call last): File "C:\Users\PRANIT\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_internal\cli\base_command.py", line 178, in main status = self.run(options, args) File "C:\Users\PRANIT\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_internal\commands\install.py", line 352, in run resolver.resolve(requirement_set) File "C:\Users\PRANIT\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_internal\resolve.py", line 131, in resolve self._resolve_one(requirement_set, req) File "C:\Users\PRANIT\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_internal\resolve.py", line 294, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "C:\Users\PRANIT\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_internal\resolve.py", line 242, in _get_abstract_dist_for self.require_hashes File "C:\Users\PRANIT\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_internal\operations\prepare.py", line 362, in prepare_linked_requirement abstract_dist.prep_for_dist(finder, self.build_isolation) File "C:\Users\PRANIT\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_internal\operations\prepare.py", line 171, in prep_for_dist self.req.prepare_metadata() File "C:\Users\PRANIT\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_internal\req\req_install.py", line 553, in prepare_metadata metadata_name = canonicalize_name(self.metadata["Name"]) File "C:\Users\PRANIT\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_internal\req\req_install.py", line 674, in metadata self._metadata = get_metadata(self.get_dist()) File "C:\Users\PRANIT\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_internal\utils\packaging.py", line 48, in get_metadata metadata = dist.get_metadata('METADATA') File "C:\Users\PRANIT\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1420, in get_metadata return value.decode('utf-8') if six.PY3 else value UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 185: invalid continuation byte 时没有出现此错误。请建议需要做什么。预先感谢!

1 个答案:

答案 0 :(得分:0)

我刚从Mac迁移到Windows,使用PowerShell和virtualenv时遇到了完全相同的问题。我改用内置的venv来代替命令行,它可以正常工作。如果您不固定使用virtualenv,可能值得尝试一下。