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.

3 Answers 3


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...

  pythonX.Y setup.py build
  pythonX.Y setup.py install --root=<my-build-area> --<other-options>

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

wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
easy_install virtualenv
virtualenv $HOME/.pystuff
source $HOME/.pystuff/bin/activate
easy_install pip
easy_install <random_pypy_stuff>
easy_install <random .egg file>
easy_install <random .tar.gz file>
pip install <other random stuff that won't install with easy_install>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .