【问题标题】:How install Flask correctly for python 3.7 to run this github project?如何为 python 3.7 正确安装 Flask 来运行这个 github 项目?
【发布时间】:2019-09-29 02:51:08
【问题描述】:

我想在我的 MacOS 上运行这个 Github 代码: https://github.com/llSourcell/AI_Startup_Prototype/tree/master/flaskSaaS-master

我有最新的 pip,Python 2.7 和 3.7

我还安装了 Flask(对于 python 3:https://dev.to/sahilrajput/install-flask-and-create-your-first-web-application-2dba

并在 PyCharm 中创建了一个 hello world

我使用来自 Github 项目的给定设置说明: 我转到文件夹(我已经下载并解压缩了 zip) 比我在终端上运行第一个设置代码:

make install && make dev 

我收到以下消息:

pip install -r requirements.txt
Collecting Flask==0.10.1 (from -r requirements.txt (line 1))
  Could not fetch URL https://pypi.python.org/simple/flask/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
  Could not find a version that satisfies the requirement Flask==0.10.1 (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for Flask==0.10.1 (from -r requirements.txt (line 1))
make: *** [install] Error 1

感谢您的帮助

【问题讨论】:

标签: python web github flask


【解决方案1】:

似乎是证书验证的问题。您可以尝试通过添加pypi.org(注册表)和files.pythonhosted.org(文件存储)作为受信任的主机来解决它。

试试这个:

pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org Flask==0.10.1

这个问题也可以通过重新安装pip来解决

【讨论】:

  • 我已经尝试并得到:```Collecting Flask==0.10.1 无法获取 URL pypi.python.org/simple/flask:确认 ssl 证书时出现问题:[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 警报协议版本(_ssl.c:590) - 跳过找不到满足 Flask==0.10.1 要求的版本(来自版本:)没有找到 Flask==0.10.1 的匹配分布```
  • 我猜您也需要将pypi.python.org 添加为受信任的主机。您是否尝试升级 pip?
  • 重新安装 pip 比运行你的代码比它有效:D
猜你喜欢
  • 1970-01-01
  • 2020-10-13
  • 2020-09-01
  • 2021-04-15
  • 2021-11-09
  • 1970-01-01
  • 2022-11-10
  • 2019-01-19
  • 1970-01-01
相关资源
最近更新 更多