问题解决: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

你可能感兴趣的:(问题解决)