无法在Raspberry Pi上使用点子安装Flask

时间:2018-09-20 07:08:14

标签: python linux flask raspberry-pi pip

我正在尝试在我的Raspberry Pi上安装Flask,但是似乎无法再通过以下命令来实现: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

有人知道出了什么问题吗?

1 个答案:

答案 0 :(得分:1)

here中描述了此问题。 简而言之,解决方法是正确设置日期,例如:

sudo date +%Y%m%d -s "20180920"

希望有帮助!