Contact SalesSitemapCustomer Login

Python easy install

Python's easy_install is similar to Perl's CPAN. You can install Python packages from a remote repository or you can use it to install python "eggs" that you have downloaded onto your local system. A python egg is basically an archive file containing the source code of the module you want to install, plus a file called setup.py. That's the file that tells easy_install what to do.

First install setuptools from http://cheeseshop.python.org/pypi/setuptools/. There are downloads for various platorms on that page.

There are a lot of options, but the most useful is simply installing a Python module. So if you want SQLAlchemy on your system, just do:

# easy_install sqlalchemy
Searching for sqlalchemy
Reading http://cheeseshop.python.org/pypi/sqlalchemy/
Couldn't find index page for 'sqlalchemy' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://cheeseshop.python.org/pypi/
Reading http://cheeseshop.python.org/pypi/SQLAlchemy/0.3.10
Reading http://www.sqlalchemy.org
Best match: SQLAlchemy 0.3.10
Downloading http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.3.10.tar.gz#md5=1e91e7430b7ec64d5f5ff51e5a9ddf58
Processing SQLAlchemy-0.3.10.tar.gz
Running SQLAlchemy-0.3.10/setup.py -q bdist_egg --dist-dir /tmp/easy_install-JPkqLA/SQLAlchemy-0.3.10/egg-dist-tmp-4f04gD
zip_safe flag not set; analyzing archive contents...
sqlalchemy.__init__: module references __file__
Adding SQLAlchemy 0.3.10 to easy-install.pth file

Installed /usr/local/python25/lib/python2.5/site-packages/SQLAlchemy-0.3.10-py2.5.egg
Processing dependencies for sqlalchemy
Finished processing dependencies for sqlalchemy

Check to make sure it's there:

$ ipython
Python 2.5.1 (r251:54863, Jul  8 2007, 09:24:05)
Type "copyright", "credits" or "license" for more information.

IPython 0.8.1 -- An enhanced Interactive Python.
?       -> Introduction to IPython's features.
%magic  -> Information about IPython's 'magic' % functions.
help    -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import sqlalchemy

In [2]:

That's it!

Retrieved from "http://wiki.vpslink.com/Python_easy_install"
Recent Changes | RSS RSS Feed