2

Yesterday I was testing some python code in my raspberry pi 3 (raspbian jessie), it required the package pytz, so I did:

sudo python3 -m pip install pytz

And then this happens:

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

It's not only with pytz, I tried to update/upgrade/reinstall pip with:

sudo python3 -m pip install -U pip

And the same error happens Any idea about how to solve this problem?

I was searching and trying to solve it yesterday and everything I can do right now is format the SD card.

My Pip version is 1.5.6 but I can't update it, even downloading the code and running setup.py, same problem.

rene
  • 41,474
  • 78
  • 114
  • 152
jmth
  • 41
  • 3

1 Answers1

0

I tried everything I could, and in my case I will recommend:

  • Copy all your important codes, changes, documents...
  • Format the SD and start all over again

I've been having short blackouts lately, that corrupted the SD card.

jmth
  • 41
  • 3