easy_install local file

Python’s answer to CPAN is the Cheeseshop, aka Python Package Index. The easiest way to install Python software is to use easy_install: for example easy_install Pylons will contact the Cheeseshop, find the latest Pylons version, and download and install it along with all dependencies. To get easy_install, you need to first install setuptools package, or use the setuptools installation script provided by some packages.

But I am occasionally faced with situations where I have downloaded a Python package already, and there may in fact not even be a publicly available version of the package anywhere. Trying easy_install --help does not seem to offer much help in this situation. However, you can simply tell easy_install the local file name, and easy_install will do the installation for you. This is mentioned on the EasyInstall website, but it would be nice if it was also spelled out clearly in the instructions you get with the –help option.

Where easy_install is lacking is that it does not support uninstall; instead you run easy_install -m package name and then manually remove the package. It also does not integrate with other packaging systems common in the Linux world. For that reason I recommend using easy_install with either some kind of virtual Python environment, or have a Python installation completely outside of the OS package manager.

Similar Posts:

2 Comments

  1. Shannon -jj Behrens:

    My approach is to pay careful attention whenever I easy_install something. Then, when I need to delete it, I:

    Delete the egg.

    Remove the mention of the egg in the whatever.pth file in site-packages.

    Delete any scripts, etc. that it installed.

    It’s not as nice as I’d like, but it definitely works.

  2. Cyberdrow:

    I find the –record option of easy_install very usefull. This gives you a logfile with a record of ever file installed to make sure you don’t forget anything to remove.

Leave a comment

Powered by WP Hashcash