Mac中python安装模块

来源:互联网 发布:windows安装python3 编辑:程序博客网 时间:2024/06/06 15:49

读取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 listxlrd (1.0.0)xlutils (2.0.0)xlwt (1.2.0)

验证是否安装成功,引入模块。打开PythonIDLE

$ pythonPython 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 darwinType "help", "copyright", "credits" or "license" for more information.>>> import xlrd>>> import xlwt>>> import xlutils>>> 
0 0