Miei articoli su Blog RedTurtle
Curriculum Vitae

Python Distutils and module distribution (part 1 - final users)

The target of this document are the final users, or a Python developer that wanna use 3rd party modules and libraries.
Part 2 will be available soons!

Standard old-way installation

First of all let me link the official guide about distutils usage.

When you download a Python module from the web and it is done in a standard way using distutils, you can install it system wide. This mean that you can install it one time and this became part of the Python libraries group of you system.

You can easilly see this if the downloaded archive has a file inside and (sometimes) a setup.cfg.

In those cases, you can easilly install the module by Python
python install
And the distutils make it all for you.

If you have more that a Python environment installed on your system, be sure that you are using the right ones.
For example:
python2.4 install

If your Python interpreter is not a system Python but you downloaded and compiled it yourself (very common on Windows) you can of course type something like this:
/home/keul/MyPythonDownloaded/bin/python install
C:\Python2.5\bin\python.exe install

Yes, this is simple, but before choosing this way to install additional Python modules, check the second way below, that is simpler!

Egg installation from the Cheeseshop (Python Package Index)

When a developer release a library in an egg format, he can also choose to release on the Cheeseshop.

The way of doing this is very simple but we will not show it there. When (as I do) release my own library in this new way, everyone can install packages without downloading anything but just typing:
easy_install pythonmodulename

Of course, you need an Internet connection, but after this the easy_install script do all the stuff for you.

Cool, isn't it?
The easy_install script is today available on all Python distribution, commonly the executable file is in the same folder where you'll find the "python" ones.

Again, you need to use the right easy_install if you have more that a Python distribution on your system.

Coming back to my Windows example, it will be...
C:\Python2.5\bin\easy_install.exe pythonmodulename