Setuptools and easy_install

If you’re like me, then you encountered modules asking you to use

easy_install

to install them. At first, it made no sense to me, but as I gained knowledge in Python, I finally understood it.

What you need to do is first install the setuptools.py scripts from PyPI. Go to http://pypi.python.org/pypi/setuptools and follow the simple installation instructions.

Once you have setuptools in your Python Scripts folder, you are meant to be able to simply call

easy_install <PACKAGE>

from the command line, but for some reason this didn’t work on my machine. Instead, I had to navigate to my Python installation directory’s scripts. for me it was

C:\Python26\Scripts\

Once in this directory, you can either type just

easy_install <PACKAGE>

or

easy_install.exe <PACKAGE>

depending on your preference.

Now let’s test our new installation of setuptools. Open up a command line and navigate to your Python Scripts directory, then type:

easy_install pygame

(No worries, this should not harm your pygame installation, in fact it may help you!)

You will get some output similar to:

C:\Python26\Scripts>easy_install pygame
Searching for pygame
Best match: pygame 1.9.1
Adding pygame 1.9.1 to easy-install.pth file

Using c:\python26\lib\site-packages
Processing dependencies for pygame

Note that if you do not already have the latest version of the chosen package, it will ouput a little more.

Basically what this program does is check the PyPI (Or cheeseshop) for your selected package. If it finds it, it scans the dependencies and files for it and installs them. If not, it looks harder and usually fails.

In case you see a module for Python that says it is on the PyPI, you can try using easy_install before manual installation, it really is easy.

Advertisements