读取Python安装路径:
which Python
安装模块管理工具pip,使用pip 安装发现报错,建议用sudo easy_install !!!
$sudo easy_install pip
安装xlrd,对excle进行读的操作;xlwt,对excle进行写的操作;
xlutils对excle进行追加写入操作;
$sudo easy_install xlrd
$sudo easy_install xlwt
$sudo easy_install xlutils
用pip管理模块,查看:
$pip list
xlrd (1.0.0)
xlutils (2.0.0)
xlwt (1.2.0)
验证是否安装成功,引入模块。打开PythonIDLE
$ python
Python 2.7.10 (default, Feb 6 2017, 23:53:20)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import xlrd
>>> import xlwt
>>> import xlutils
>>>