【问题标题】:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 33: invalid continuation byteUnicodeDecodeError:“utf-8”编解码器无法解码位置 33 中的字节 0xe4:无效的继续字节
【发布时间】:2017-08-12 17:29:03
【问题描述】:

我在为我的 python 安装 matplotlib 工具包时遇到问题。 给出命令后 pip install basemap-1.1.0-cp36-cp36m-win32.whl 在我的 windows 命令提示符下,安装很快开始并运行了一段时间,但在那之后,它停止并只给我以下消息:

Exception:
Traceback (most recent call last):
  File "c:\users\lasse\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 0xe4 in position 33: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\lasse\appdata\local\programs\python\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\users\lasse\appdata\local\programs\python\python36-32\lib\site-packages\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "c:\users\lasse\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "c:\users\lasse\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_set.py", line 634, in _prepare_file
    abstract_dist.prep_for_dist()
  File "c:\users\lasse\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "c:\users\lasse\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_install.py", line 439, in run_egg_info
    command_desc='python setup.py egg_info')
  File "c:\users\lasse\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\lasse\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 0xe4 in position 33: invalid continuation byte.

我试图寻找答案,但我能找到的一切都与安装无关,而是用户自己编写的代码,所以我不知道如何将这些信息应用到我的案例中。

【问题讨论】:

  • 为什么你不能只做pip install matplotlib ??基本上这将安装任何依赖项。
  • 成功了,谢谢!我认为整个 .whl 包是 matplotlib,因此这就是我下载 matplotlib 时得到的。不知道你可以只安装它的某些部分。
  • 我在答案中添加了相同的内容。如果有帮助,请考虑打勾或投票。谢谢

标签: python python-3.x matplotlib installation


【解决方案1】:

pip install matplotlib

您正在安装 matplotlib 依赖项的特定版本。但是上面的命令会自动安装任何支持版本的依赖。这将特定于您的 python 版本。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-11
    • 2020-11-02
    • 2021-01-02
    • 2021-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-29
    相关资源
    最近更新 更多