2017-09-04 210 views
0

我是新來編碼。雖然我嘗試使用python3的pip3安裝python-forecastio,但它給了我下面的錯誤。pip3安裝時出現SSL錯誤

$ sudo pip3 install --trusted-host pypi.python.org python-forecastio 

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 

Collecting python-forecastio 

    Could not fetch URL https://pypi.python.org/simple/python-forecastio/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping 

    Could not find a version that satisfies the requirement python-forecastio (from versions:) 

No matching distribution found for python-forecastio 
+0

的原因是沒有安裝OpenSSL的相關軟件, 嘗試百勝安裝的OpenSSL的OpenSSL devel的 然後一切正常。 –

+0

你在運行什麼樣的設置沒有內置的SSL模塊? – kichik

回答

1

問題在於,正如您可能已經猜到的那樣,SSL模塊不可用。 所以解決這個問題的簡單方法是重新安裝python。但另一種方法是運行這一簡單的代碼行:import ssl。如果你得到一個錯誤,你會知道你的python 3安裝已損壞,所以你需要重新安裝python,或者如果你沒有得到一個錯誤嘗試使用easy_install-3.x (what ever the module or link you want)(使用特定的python你已經安裝版本,而不是「x」)。希望我幫助!

-Zeus