问题解决:python2 pip安装pillow报错

想生成个图片验证码,使用的PIL,怎么都下载不下来,说是PIL被取代了,改成Pillow,好吧,继续安装这个,我是centos7上安装,python2.7.5。

附上官网的各种安装方式:https://pillow.readthedocs.io/en/latest/installation.html#python-support

captcha这个库生成验证码很方便,但是也依赖PIL,要使用的可以看下

版本对应

Python

3.10

3.9

3.8

3.7

3.6

3.5

3.4

2.7

Pillow >= 8.4

Yes

Yes

Yes

Yes

Yes

Pillow 8.0 - 8.3

Yes

Yes

Yes

Yes

Pillow 7.0 - 7.2

Yes

Yes

Yes

Yes

Pillow 6.2.1 - 6.2.2

Yes

Yes

Yes

Yes

Yes

Pillow 6.0 - 6.2.0

Yes

Yes

Yes

Yes

Pillow 5.2 - 5.4

Yes

Yes

Yes

Yes

Yes

Python

3.6

3.5

3.4

3.3

3.2

2.7

2.6

2.5

2.4

Pillow 5.0 - 5.1

Yes

Yes

Yes

Yes

Pillow 4

Yes

Yes

Yes

Yes

Yes

Pillow 2 - 3

Yes

Yes

Yes

Yes

Yes

Yes

Pillow < 2

Yes

Yes

Yes

Yes

报错

Requirement already satisfied (use --upgrade to upgrade): pillow in /opt/nsfocus/espc/deps/env/lib/python2.7/site-packages
/opt/nsfocus/espc/deps/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/opt/nsfocus/espc/deps/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: 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.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning

解决方案:

搜了好久,各种回答都有,下面这个方法解决了,使用豆瓣源http,跳过ssl验证

pip install -i http://pypi.douban.com/simple pillow==6.2.0 --trusted-host pypi.douban.com

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值