關於 pip安裝的可能錯誤的排除

今天安裝selenium老是報錯(下爲錯誤信息)html

C:\Python27\Scripts>pip install selenium
Collecting selenium
C:\Python27\lib\site-packages\pip-10.0.0b2-py2.7.egg\pip\_vendor\urllib3\util\ss
l_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subje
ct Name Indication) extension to TLS is not available on this platform. This may
cause the server to present an incorrect TLS certificate, which can cause valid
ation failures. You can upgrade to a newer version of Python to solve this. For
more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.ht
ml#ssl-warnings
SNIMissingWarning
C:\Python27\lib\site-packages\pip-10.0.0b2-py2.7.egg\pip\_vendor\urllib3\util\ss
l_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
InsecurePlatformWarning
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/sel
enium/
C:\Python27\lib\site-packages\pip-10.0.0b2-py2.7.egg\pip\_vendor\urllib3\util\ss
l_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
InsecurePlatformWarning
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/sel
enium/
C:\Python27\lib\site-packages\pip-10.0.0b2-py2.7.egg\pip\_vendor\urllib3\util\ss
l_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
InsecurePlatformWarning
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/sel
enium/
C:\Python27\lib\site-packages\pip-10.0.0b2-py2.7.egg\pip\_vendor\urllib3\util\ss
l_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
InsecurePlatformWarning
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/sel
enium/
C:\Python27\lib\site-packages\pip-10.0.0b2-py2.7.egg\pip\_vendor\urllib3\util\ss
l_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
InsecurePlatformWarning
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SS
L routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/sel
enium/
C:\Python27\lib\site-packages\pip-10.0.0b2-py2.7.egg\pip\_vendor\urllib3\util\ss
l_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
InsecurePlatformWarning
Could not fetch URL https://pypi.python.org/simple/selenium/: There was a prob
lem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org',
port=443): Max retries exceeded with url: /simple/selenium/ (Caused by SSLError(
SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv
1 alert protocol version'),)) - skipping
Could not find a version that satisfies the requirement selenium (from version
s: )
No matching distribution found for selenium
C:\Python27\lib\site-packages\pip-10.0.0b2-py2.7.egg\pip\_vendor\urllib3\util\ss
l_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. T
his prevents urllib3 from configuring SSL appropriately and may cause certain SS
L connections to fail. You can upgrade to a newer version of Python to solve thi
s. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-u
sage.html#ssl-warnings
InsecurePlatformWarning
Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem con
firming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', port=44
3): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1,
'_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert prot
ocol version'),)) - skippingpython

 

能夠解決問題的解決方法:網絡

此狀況只用於網絡不順暢的安裝模塊背景:app

 

總出現紅色的fetch

Could not find a version that satisfies the requirement pymongo(from version:)

ui

你可能會遇到下面這樣的狀況:this

是由於網絡的問題,要使用國內的鏡像源來加速url

 

解決辦法:命令行

你須要的是在你的命令行下面添加一句3d

例如:本來執行的命令是:

pip install selenium

改成:

pip install selenium -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

結果會就成功:

ok!問題解決!

相關文章
相關標籤/搜索