Raspberry python3.4点错误未知编码cp437

时间:2017-07-04 13:15:23

标签: python pip install

昨天我在我的覆盆子pi 3(raspbian jessie)中测试了一些python代码,它需要包pytz,所以我做了:

sudo python3 -m pip install pytz

然后发生这种情况:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 290, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 1198, in prepare_files
    do_download,
  File "/usr/lib/python3/dist-packages/pip/req.py", line 1376, in unpack_url
    self.session,
  File "/usr/lib/python3/dist-packages/pip/download.py", line 582, in unpack_http_url
    unpack_file(temp_location, location, content_type, link)
  File "/usr/lib/python3/dist-packages/pip/util.py", line 640, in unpack_file
    unzip_file(filename, location, flatten=not filename.endswith(('.pybundle', '.whl')))
  File "/usr/lib/python3/dist-packages/pip/util.py", line 510, in unzip_file
    zip = zipfile.ZipFile(zipfp)
  File "/usr/lib/python3.4/zipfile.py", line 937, in __init__
    self._RealGetContents()
  File "/usr/lib/python3.4/zipfile.py", line 1016, in _RealGetContents
    filename = filename.decode('cp437')
LookupError: unknown encoding: cp437

不仅是pytz,我还尝试用以下内容更新/升级/重新安装pip:

sudo python3 -m pip install -U pip

发生同样的错误 有关如何解决这个问题的任何想法?

我昨天正在寻找并试图解决它 我现在能做的就是格式化SD卡。

我的Pip版本是1.5.6,但我无法更新它,即使下载代码并运行setup.py,同样的问题。

1 个答案:

答案 0 :(得分:0)

我尽我所能,在我的情况下,我会建议:

  • 复制所有重要的代码,更改,文档......
  • 格式化SD并重新开始

我最近一直在停电,这使SD卡损坏了。