Python win环境pip安装第三方库时一直报错:pip is configured with locations that require TLS/SSL, however the ssl mo

pip 安装第三方库包thriftpy2时一直报错:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting thriftpy2
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/thriftpy2/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/thriftpy2/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/thriftpy2/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/thriftpy2/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/thriftpy2/
  Could not fetch URL https://pypi.org/simple/thriftpy2/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/thriftpy2/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
  Could not find a version that satisfies the requirement thriftpy2 (from versions: )
No matching distribution found for thriftpy2

多方查询,最后参考文章
https://blog.csdn.net/marueibo/article/details/86678936
得知:是缺少openssl或者版本过低。

按照文章中建议的方法,进入地址https://slproweb.com/products/Win32OpenSSL.html,点击以下链接下载安装包:


下载好后直接点击执行,同意服务条款后一路默认选项下一步直至完成。

再运行pip:成功!


D:\software\jqdatasdk-master>pip --trusted-host pypi.python.org install thriftpy2
Collecting thriftpy2
  Downloading https://files.pythonhosted.org/packages/78/9b/f415dc3b1a17d52a0dbfe311f1c3250469ad219a0bdb506eb8050245c8d4/thriftpy2-0.4.10.tar.gz (301kB)
    100% |████████████████████████████████| 307kB 468kB/s
Requirement already satisfied: ply<4.0,>=3.4 in d:\software\anaconda3\lib\site-packages (from thriftpy2) (3.11)
Building wheels for collected packages: thriftpy2
  Running setup.py bdist_wheel for thriftpy2 ... done
  Stored in directory: C:\Users\asyou\AppData\Local\pip\Cache\wheels\4c\ce\d1\710c5210049505afcce50112db350a76cd481a1575e832d79a
Successfully built thriftpy2
Installing collected packages: thriftpy2
Successfully installed thriftpy2-0.4.10

你可能感兴趣的:(Python数据分析)