2017-09-04 170 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