I'm setting up a new server based on RHEL5 and wanted to install some python modules which don't come with it. I've seen that setuptools have an option to build RPM packages out of modules, but unfortunately this only works with setup.py
, not with easy_install
. However, I'd like to keep dependency resolving of easy_install
so that manual setup.py
is not an option.
How would you solve this situation? I would like to avoid installing packages to /usr/local
especially since stock python from RHEL5 doesn't define a python path underneath of /usr/local
by default.
If you can use additional RPM repositories, one option is to see if the Python package you're looking for is available in the EPEL (Extra Packages for Enterprise Linux) repository.
See http://fedoraproject.org/wiki/EPEL
Firstly, I try not to install anything unless directly from the OS distribution (Red Hat, Debian, etc) - as a first attempt. Of course the problem there is, specially with Enterprise distributions, that many things are not available.
In this case, I would again not rely on anything generating an RPM for me, just because it's packaged up in an RPM doesn't mean it's good.
What I would do (well what I do do :) is write the spec file for creating a package for this Python module yourself.
Specifically with setup tools...
This way you can have full control of where things are installed.
The easy and python friendly way to do this is to use virtualenv. This has the caveat of only being available after running the source $HOME/.pystuff/bin/activate command, but has the benefit of making the entire world of python packages available to you with only minimal pollution of your system distribution.
Obviously you can search for and build your own system python packages, but honestly, for most uses it's more hassle than it's worth. If you're going to do that, start with seutptools and virtualenv, obviously =p