2

Made a clean install of Raspbian Jessie on my RPi v2B. Made a static ip over ethernet using https://www.raspberrypi.org/forums/viewtopic.php?t=124423 to use putty and RealVNC of which both are working.

But I cannot install anything with pip. I get the error that follows.

Terminal Error:

pi@raspberrypi:~/Downloads $ pip install Flask
Downloading/unpacking Flask
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/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/python2.7/dist-packages/pip/req.py", line 1178, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 194, in find_requirement
page = self._get_page(main_index_url, req)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_page
session=self.session,
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 694, in get_page
req, link, "connection error: %s" % exc, url,
TypeError: __str__ returned non-string (type Error)

Storing debug log for failure in /home/pi/.pip/pip.log
pi@raspberrypi:~/Downloads $ sudo pip install Flask
Downloading/unpacking Flask
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/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/python2.7/dist-packages/pip/req.py", line 1178, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 194, in find_requirement
page = self._get_page(main_index_url, req)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_page
session=self.session,
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 694, in get_page
req, link, "connection error: %s" % exc, url,
TypeError: __str__ returned non-string (type Error)

Storing debug log for failure in /root/.pip/pip.log
pi@raspberrypi:~/Downloads $ 

I can install whl packages over pip if I download them from the net, but nothing straight from pip. I even reuploaded the Jessie image to the sd after formatting it again and the problem still persists. Nothing of the sort happens on my Wheezy sd card.

(maybe nothing but when I try to access SSH in raspi-config I get a message saying:

Initial ssh key generation still running. Please wait and try again.

and when I hit ok There was an error running operation A4 SSH hitting ok again closes that page. It's been 4 hours and the message still persists.)

2
  • Initial ssh key generation still running. Please wait and try again. -> Should probably not take more than a number of seconds, so something is wrong there.
    – goldilocks
    Commented Jul 13, 2016 at 12:06
  • Hmmm: raspberrypi.stackexchange.com/q/51154/5538 Although these look like duplicates since they have been asked closed together by different users I will leave them both open for now.
    – goldilocks
    Commented Jul 13, 2016 at 12:26

1 Answer 1

4

I got exactly the same problem with Raspbian Jessie Lite image.

Incredibly I've solved this problem by setting the correct time and date as explained in Broken Python PIP install; What is the correct way to fix?

To set the date I used $ sudo date -s "Jul 7 18:31"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.