I tried installing pubnub. I went through the website of pubnub and did as it was told on the website. https://www.pubnub.com/blog/2015-07-22-getting-started-with-raspberry-pi-2-and-pubnub-in-python-programming-language/

While I tried to do pip install pubnub (sudo pip install pubnub), the following error occured. I can't install it no matter how much I try.

Here is the error:

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 196, in find_requirement
    url_name = self._find_url_name(Link(self.index_urls[0], trusted=True), url_name, req) or req.url_name
  File "/usr/lib/python2.7/dist-packages/pip/index.py", line 361, in _find_url_name
    page = self._get_page(index_url, req)
  File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_page
  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

Does anybody have any solution so that I can install it?

1 Answer 1


Can you check your Raspberry pi time. Sometimes it so happens when your system time is inaccurate the pip installation fails. I have faced this issue once.

You may check the articles below on how to set the time. How to force NTPD to update date/time after boot?

Hope this helps.


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.