繁体   English   中英

如何使用python 3.7.4在windows上使用pip安装flask并安装pip?

[英]how to install flask using pip on windows using python 3.7.4 and install pip?

当我执行pip install Flask ,出现错误:

Could not find a version that satisfies the requirement Flask (from versions: )
No matching distribution found for Flask

我该怎么做才能安装 Flask?

Microsoft Windows [Version 10.0.17134.885]
(c) 2018 Microsoft Corporation. כל הזכויות שמורות.

C:\Users\מחשב>cd Documents

C:\Users\מחשב\Documents>cd C:\Users\מחשב\Documents\pyton

C:\Users\מחשב\Documents\pyton>mkdir myproject
A subdirectory or file myproject already exists.

C:\Users\מחשב\Documents\pyton>myproject
'myproject' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\מחשב\Documents\pyton>mkdir myproject

C:\Users\מחשב\Documents\pyton>cd myproject

C:\Users\מחשב\Documents\pyton\myproject>python3 -m venv venv
'python3' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\מחשב\Documents\pyton\myproject>py -3 -m venv venv

C:\Users\מחשב\Documents\pyton\myproject>venv\Scripts\activate

(venv) C:\Users\מחשב\Documents\pyton\myproject>pip install Flask
Collecting Flask
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))': /simple/flask/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))': /simple/flask/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))': /simple/flask/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))': /simple/flask/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))': /simple/flask/
  Could not fetch URL https://pypi.org/simple/flask/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/flask/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))) - skipping
  Could not find a version that satisfies the requirement Flask (from versions: )
No matching distribution found for Flask
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))) - skipping

(venv) C:\Users\מחשב\Documents\pyton\myproject>python -m ensurepip --default-pip
Looking in links: C:\Users\84D7~1\AppData\Local\Temp\tmpljqyz7od
Requirement already satisfied: setuptools in c:\users\מחשב\documents\pyton\myproject\venv\lib\site-packages (40.8.0)
Requirement already satisfied: pip in c:\users\מחשב\documents\pyton\myproject\venv\lib\site-packages (19.0.3)

(venv) C:\Users\מחשב\Documents\pyton\myproject>pip -V
pip 19.0.3 from c:\users\מחשב\documents\pyton\myproject\venv\lib\site-packages\pip (python 3.7)

(venv) C:\Users\מחשב\Documents\pyton\myproject>py -3 -m venv venv

(venv) C:\Users\מחשב\Documents\pyton\myproject>venv\Scripts\activate

(venv) C:\Users\מחשב\Documents\pyton\myproject>pip install Flask
Collecting Flask
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))': /simple/flask/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))': /simple/flask/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))': /simple/flask/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))': /simple/flask/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))': /simple/flask/
  Could not fetch URL https://pypi.org/simple/flask/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/flask/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))) - skipping
  Could not find a version that satisfies the requirement Flask (from versions: )
No matching distribution found for Flask
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))) - skipping

(venv) C:\Users\מחשב\Documents\pyton\myproject>

从pypi下载包的时候貌似出现了SSL认证错误:

无法获取 URL https://pypi.org/simple/pip/ :确认 ssl 证书时出现问题:HTTPSConnectionPool(host='pypi.org', port=443):

您可以尝试将 pypi 添加为受信任的主机并重新安装吗? 类似的东西:

pip install --trusted-host pypi.python.org flask 

希望这有帮助!

最后我找到了一个句子 --trusted-host files.pythonhosted.org --trusted-host pypi.org --trusted-host pypi.python.org 这个工作!!!!!! 当您在计算机上进行阻止时您需要在您想要的库之前删除安全性

pip install --trusted-host files.pythonhosted.org --trusted-host pypi.org --trusted-host pypi.python.org Flask

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM