Python安装第三方包报错:InsecurePlatformWarning: A true SSLContext object is not available.

# 执行pip install dataset报错如下
InsecurePlatformWarning: A true SSLContext object is not available. 
This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. 
For more information,see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning

解决方法
因为SSL的问题,urllib3需要pyopenssl。

pip install pyopenssl ndg-httpsclient pyasn1

还需要安装libffi-dev,libssl-dev
1.Ubuntu下安装

sudo apt-get install libffi-dev libssl-dev

2.CentOS下安装

yum install libffi-devel openssl-devel

你可能感兴趣的:(python)