pip3安装时出现SSL错误

时间:2017-09-04 23:33:12

标签: python python-3.x pip

我是编码的新手。虽然我尝试使用pip3为python3安装python-forecastio,但它给出了以下错误。

$ 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

1 个答案:

答案 0 :(得分:1)

有什么问题,正如您可能已经猜到的那样,SSL模块不可用。 所以解决问题的简单方法是重新安装python。但另一种方法是运行这一简单的代码:import ssl。如果您收到错误,您将知道您的python 3安装已损坏,因此您需要重新安装python,或者如果您没有收到错误,请尝试使用easy_install-3.x (what ever the module or link you want)(使用已安装版本的特定python) " x")。希望我帮忙!

-Zeus