python - 无法在我的 Raspberry Pi 上使用 pip 安装 Flask

标签 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

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

最佳答案

这个问题描述here . 简而言之,解决方法是正确设置日期,例如:

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

希望对您有所帮助!

关于python - 无法在我的 Raspberry Pi 上使用 pip 安装 Flask,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52419481/

相关文章:

python - 平均数从最高到最低

python - 使用 xlwt,在达到 xls 行限制时创建一个新工作表

linux - 无限循环 shell 脚本没有被杀死

c - 我无法理解所有 : ex1 in Makefile?(艰难地学习 C)

python - Pyramid 函数中对象的范围

python - 将 HttpResponse 存储在字典中

c - 查明二进制文件是否已使用堆栈粉碎保护进行编译

python - 如何在 flask 中只执行一次代码块?

postgresql - 如何更改 postgresql 中的默认数据库位置?

python - resource 可选参数,用于检索 Flask Restful 上的所有数据