参考资料:https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/00140767171357714f87a053a824ffd811d98a83b58ec13000
https://www.cnblogs.com/xianyue/p/6588869.html
https://blog.youkuaiyun.com/tianxiawuzhei/article/details/44922843
https://blog.youkuaiyun.com/sinat_25704999/article/details/50118465
1、除了内建的模块外,Python还有大量的第三方模块。基本上,所有的第三方模块都会在PyPI - the Python Package Index上注册,只要找到对应的模块名字,即可用easy_install或者pip安装。
2、PIL是常用的第三方模块之一,全称Python Imaging Library,已经是Python平台事实上的图像处理标准库了。Window系统下使用PIL前需要作如下准备工作:
(1)从官网下载PIL安装包:http://pythonware.com/products/pil/
(2)安装时会提示在注册表中找不到Python2.7,可运行下面的python程序将Python2.7安装信息写入注册表。
#
# script to register Python 2.0 or later for use with win32all
# and other extensions that require Python registry settings
#
# written by Joakim Loew for Secret Labs AB / PythonWare
#
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm
#
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html
import sys
from _winreg import *
# tweak as necessary
version = sys.version[:3]
installpath = sys.prefix
regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
installkey = "InstallPath"
pythonkey