解决python2.7不能使用pip下载的问题

在使用python2.7.5的时候
1.使用pip install pyMySql 或者安装whl包的时候出现这个问题
 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.

 SNIMissingWarning: An HTT
PS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrec
t TLS certificate, which can cause validation failures
导致安装包一直不成功,网上看了好多办法,都说的不行,下面看我的做法,解决window上这个问题

第一步: 在${user}盘符下创建一个文件夹 pip ,在pip文件夹中新建pip.ini文件,内容如下:
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/

在命令行执行pip命令时,指定--trusted-host ,完整命令如下:
pip2 --trusted-host mirrors.aliyun.com install D:\developTool\pytho
n\python27\PyMySQL-0.9.2-py2.py3-none-any.whl

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值