{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "[Python for Developers](http://ricardoduarte.github.io/python-for-developers/#content)\n", "===================================\n", "First edition\n", "-----------------------------------\n", "\n", "Chapter 12 : Third Party Libraries\n", "=============================\n", "_____________________________\n", "There are many libraries written by others available for Python, consisting of packages or modules, that implement many features beyond the standard library.\n", "\n", "Generally, the libraries are distributed in the following ways:\n", "\n", "+ *distutils* packages.\n", "+ Package managers from operating system.\n", "+ Installers.\n", "+ Python Eggs.\n", "\n", "Packages using *distutils* module, which is distributed with Python, are very popular. The packages are distributed in compressed files (usually \".tar.gz\" , \".tar.bz2\" or \".zip \" ). To install, you must unzip the file, go into the folder that was unzipped, and to execute the command:\n", "\n", " python setup.py install\n", "\n", "The package will be installed in \"site-packages\" folder in Python.\n", "\n", "Package managers from operating System usually work with their own packet formats, like \".deb\" (Debian Linux) or \".rpm\" (RedHat Linux). How to install the packages depends on the manager. The big advantage is that the package manager takes care of dependencies and updates.\n", "\n", "Installer programs are nothing more than executables that install the library. They are generally used in Windows environments and can be uninstalled from the Control Panel.\n", "\n", "Egg is a Python package format (with the extension \".egg\") which is administered by the easy_install utility, which is part of the project [setuptools](http://peak.telecommunity.com/DevCenter/setuptools/). Similar to some tools found in other languages such as Ruby Gems, it is gradually becoming the de facto standard for distributing libraries in Python.\n", "\n", "The program finds the newest version of the package in [PYPI](http://pypi.python.org/pypi) (*Python Package Index*), the Python package repository, and also tries to install dependencies as needed.\n", "\n", "Python Egg packages can be installed via the command:\n", "\n", " easy_install package_name\n", "\n", "The easy_install *script* is installed in the \"scripts\" folder of Python." ] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [ { "html": [ "\n", "" ], "output_type": "pyout", "prompt_number": 1, "text": [ "" ] } ], "prompt_number": 1 } ], "metadata": {} } ] }