[英]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.