easy_install是帮助Python开发者安装管理module的工具,以下是其安装使用的简要介绍
下载easy_install并安装
easy_install的安装包叫做setuptools,可以在这里下载 http://pypi.python.org/pypi/setuptools
本文中我们下载setuptools-15.2.tar.gz的源码包,将其解压,并用系统中的Python运行ez_setup.py文件(需要sudo权限)
sudo python ez_setup.py
此脚本会自动下载所需的安装文件,成功运行后,easy_install将被安装到/usr/local/bin目录
使用easy_install安装python模块
以numpy模块为例
sudo easy_install numpy
这里我们有可能会遇到SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.的错误,因为许多系统默认安装了python,但没有安装python-dev,

本文介绍了Python开发者如何下载和安装easy_install工具,以及使用它来安装python模块,如numpy。在安装easy_install时,需要从指定网址下载源码包,解压后以Python运行安装脚本。当使用easy_install安装模块时,可能需要先安装python-dev以避免错误。成功安装后,可以顺利安装numpy等模块。
最低0.47元/天 解锁文章
9937

被折叠的 条评论
为什么被折叠?



