安装easy_install的目的:
python安装第三方库一般有两种方式:
1:普通安装
下载压缩包,解压出来,找到setup.py文件
命令行下使用
X:解压路径下> python setup.py install
2:使用easy_install安装
用于安装egg扩展名的包,egg可以认为就是zip,只是扩展名不同。
在命令行上 指定包的名称(会搜索PyPI)、指定包文件的网上路径、本地文件路径、当前目录 进行安装和更新
X:> easy_install 路径
例如:要安装python的mongoDB驱动,命令行中输入瑞星啊命令
easy_install pymongo即可自动匹配安装合适的pymongo
所以安装easy_install有助于简化python第三方库的安装。
easy_install在windows下的安装:
Downloading and Installing a Package
easy_install使用的 一些例子
For basic use of easy_install, you need only supply the filename or URL of a source distribution or .egg file (Python Egg).
Example 1. Install a package by name, searching PyPI for the latest version, and automatically downloading, building, and installing it:
easy_install SQLObject
Example 2. Install or upgrade a package by name and version by finding links on a given "download page":
easy_install -f http://pythonpaste.org/package_index.html SQLObject
Example 3. Download a source distribution from a specified URL, automatically building and installing it:
easy_install http://example.com/path/to/MyPackage-1.2.3.tgz
Example 4. Install an already-downloaded .egg file:
easy_install /my_downloads/OtherPackage-3.2.1-py2.3.egg
Example 5. Upgrade an already-installed package to the latest version listed on PyPI:
easy_install --upgrade PyProtocols
Example 6. Install a source distribution that's already downloaded and extracted in the current directory (New in 0.5a9):
easy_install .
Example 7. (New in 0.6a1) Find a source distribution or Subversion checkout URL for a package, and extract it or check it out to ~/projects/sqlobject (the name will always be in all-lowercase), where it can be examined or edited. (The package will not be installed, but it can easily be installed with easy_install ~/projects/sqlobject. See Editing and Viewing Source Packages below for more info.):
easy_install --editable --build-directory ~/projects SQLObject