一、前言
遇到客户给了一个需求,需要拼接多个图片,上网找到一个解决方式,不过是需要安装PIL的,相信安装过这个库的应该都遇到很多问题,接下来说说怎么解决。
我的环境是:
操作系统:win10 64bit
python版本:2.7.15
二、问题
1. 使用pip安装
使用命令:
pip install PIL
提示:
Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
2. 直接安装windows安装包
在python lib网站(http://effbot.org/downloads/#Imaging),可以下载PIL-1.1.7.win32-py2.7.exe,直接安装。
提示:Python version 2.7 required…
主要原因是安装这个的时候需要去注册表找python相关信息,也就是安装的时候是和当前有依赖的,可以下载网站上的脚本(http://effbot.org/zone/python-register.htm)来修复一下:
#
#script to register Python 2.0 or later for use with win32all#and other extensions that require Python registry settings#
#written by Joakim Löw for Secret Labs AB / PythonWare#
#source:#http://