无法使用python3.7和pip3.7安装flask

时间:2019-09-04 22:51:29

标签: python-3.x pip rhel7

我试图在具有rhel7的linux机器中使用python pip安装flask

-> python3.7 --version
Python 3.7.2
-> pip3.7 --version
pip 18.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

问题:

-> pip3.7安装烧瓶

Collecting flask
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f60b8>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f6128>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f6390>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f6358>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f64e0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
  Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask

我也尝试使用以下命令,但存在相同的错误

python3.7 -m pip install flask

2 个答案:

答案 0 :(得分:0)

尝试此代码:

pip3 install flask

或者:

pip install flask

祝你好运。

答案 1 :(得分:-1)

我建议您看看这个Flask documentation page。如文档中所述,您需要先activate the environment,然后通过运行命令pip install Flask来继续安装。

此文档还涉及Python 2.7。遵循此文档时请记住这一点。