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.

Multiple Python installations on one computer (Part 1)

So, I now have four different Python installations running at the same time, they are:

Python 2.5

Python 2.6 (My preference)

Python 2.7a

Python 3.1

So far, I have not met any problems on this setup, except for a slight pain. .py files and friends are all associated with Python 2.6, which is what I want, but the “python” command line command is associated with Python 2.5. So, if I want to run a program in 2.5, I just type the python prefix, else, I just type the filename. There seems to be no real benefit nor drawback to having multiple installations as you will most likely end up only using one anyway. Even so, if you can properly manage your installations, I recommend having a setup similar to my own.

Keep in mind I’m still working this out, once I get it, I’ll be sure to post an update with the new info.
I also plan on making this into a series with useful info about this.

Introduction

Welcome to my new feed, Novice to Pro. Here I will post various findings I stumble upon in my journey from Novice to Pro.

I am an unproffesional programmer, I am self-taught and use Python primarily. Although I do know the basics of a handful of languages. Besides Python, I use C++, C#, Javascript, CSS, HTML, and a few others I can’t think of at the moment. When using Python, I normally write games using the excellent Pygame library. I’ve tried a few others like pyglet and rabbyt, but none of them seemto really compare to Pygame’s simplicity and power.
Anyway, enough rambling on about Python, let’s talk about this blog. Novice to Pro is aimed to be a place with all the knowledge I wish I had when I was learning. I’ve already found a few useful tips and tricks that I’ll be sharing shortly after this post, but keep in mind that NtP will be formuch more than just programming.

Now, if you’re intrigued, subscribe, if not, don’t. Just keep it in mind for a later date.